Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Software Development Software Development
Search Search
Search for:
Tech Support Guy > > >

Java code can be executed on any major platform?


(!)

ImDatingJava's Avatar
ImDatingJava ImDatingJava is offline
Computer Specs
Account Disabled with 17 posts.
THREAD STARTER
 
Join Date: Jul 2012
Experience: Beginner
30-Jul-2012, 03:30 PM #1
Lightbulb Java code can be executed on any major platform?
For example, say writing Java code from a Java IDE on Ubuntu, will it work?

I'm installing Ubuntu, and I know C++ can be compiled and run on its API, text-based or graphical, but Java is different.
Ent's Avatar
Ent   (Josiah) Ent is offline Ent is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 5,289 posts.
 
Join Date: Apr 2009
Location: United Kingdom
Experience: Intermediate
30-Jul-2012, 04:27 PM #2
Java runs in what is called a virtual machine. That means that you'll install Java onto your computer, and Java then executes the code in the java program you want to run. If you have the appropriate version of the virtual machine on your computer, you can run a Java program irrespective of what platform you're using or platform it was compiled on.
If you don't have the virtual machine, or if you have an older version, you cannot run a Java program.

So the answer to your question is yes, but only if you have the right version of the VM installed.
ruchiwebsol's Avatar
ruchiwebsol   (ruchiwebsol) ruchiwebsol is offline
Computer Specs
Member with 2 posts.
 
Join Date: Aug 2012
Location: india
02-Aug-2012, 05:24 AM #3
An edition of the Java platform is the name for a bundle of related programs from Sun that allow for developing and running programs written in the Java programming language. The platform is not specific to any one processor or operating system, but rather an execution engine (called a virtual machine) and a compiler with a set of libraries that are implemented for various hardware and operating systems so that Java programs can run identically on all of them.
ruchiwebsol's Avatar
ruchiwebsol   (ruchiwebsol) ruchiwebsol is offline
Computer Specs
Member with 2 posts.
 
Join Date: Aug 2012
Location: india
02-Aug-2012, 05:25 AM #4
Java code can be executed on any major platform?
The heart of the Java platform is the concept of a "virtual machine" that executes Java bytecode programs. This bytecode is the same no matter what hardware or operating system the program is running under. There is a JIT(Just In Time) compiler within the Java Virtual Machine, or JVM. The JIT compiler translates the Java bytecode into native processor instructions at run-time and caches the native code in memory during execution.
The use of bytecode as an intermediate language permits Java programs to run on any platform that has a virtual machine available. The use of a JIT compiler means that Java applications, after a short delay during loading and once they have "warmed up" by being all or mostly JIT-compiled, tend to run about as fast as native programs.[citation needed] Since JRE version 1.2, Sun's JVM implementation has included a just-in-time compiler instead of an interpreter.
Although Java programs are cross-platform or platform independent, the code of the Java Virtual Machines (JVM) that execute these programs is not. Every supported operating platform has its own JVM
ImDatingJava's Avatar
ImDatingJava ImDatingJava is offline
Computer Specs
Account Disabled with 17 posts.
THREAD STARTER
 
Join Date: Jul 2012
Experience: Beginner
02-Aug-2012, 03:24 PM #5
Yeah, thanks everyone.

I am learning Java now and I know about its JIT compiler and the Java Virtual Machine pretty well.

Thanks again.
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


Tags
c plus plus, c++, java, platforms, ubuntu

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑

Content Relevant URLs by vBSEO 3.3.2