• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Java Virtual Machine

 
Ranch Hand
Posts: 580
Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Marshal
Posts: 79973
396
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Yup, yup, yup. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic