• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Virtual Machine  RSS feed

 
James Tharakan
Ranch Hand
Posts: 580
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java is a platform independent language.
But i cannot run my java program in a system which does not have Java Virtual Machine.
So how is it system independent??

If i have to install Java Virtual Machine in every system to run the program then i can do the same with regrads to other programming languages by installing their compiler.

Hope my question is not a stupid question .
Please do explain it to me .
Thank you.
 
Ramya Chowdary
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your Java Program is platform independent ,Not the JVM

you need JVM specific to your platform to run the java program...
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by James Tharakan:
Java is a platform independent language.
But i cannot run my java program in a system which does not have Java Virtual Machine.
So how is it system independent??


java is an interpreted language. one thing JVM is not a platform independent. every Operating System needs its own JVM.

example if you compile a java file in windows,then you take the compiled file (.class) into unix,then if you run it will run...

but no idea about other language
 
Campbell Ritchie
Marshal
Posts: 56595
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As long as you follow a few simple rules eg use println rather than \n, the very same Java code and Java bytecode will run unchanged on machines with different operating systems, different CPUs, etc. But, as Pratap koritala has told you, you have to have different Java runtime environments (JREs) for different computers. (The JRE is included in the JDK you installed).

And welcome to JavaRanch
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!