• 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

basic java

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi to all,
my doubt is whether the java virtual machine is available in the operating system or as part of the jdk kit.
It is said that the jvm is system dependent and the .class files are system independent.
for ex:I have two pcs ,where linux runs on one machine and windows on another machine.I have a jdk1.5 kit to install on both of the systems.so does the same jdk1.5 kit works for both the operating systems or i should get some other jdk.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JVM is part of the JDK or the JRE, but it may come preinstalled with your operating system. If it is, you have either the JDK or the JRE as well. Confusing, isn't it?

The bottom line is, if you know that you have a JDK installed on both machines, you are set to run Java.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JVM (Java Virtual Machine) is the engine.
The JRE (Java Runtime Environment) is the complete car, including the engine.

The JDK (Java Development Kit) includes the JRE (and JVM) and a bunch of tools that you need when you want to write your own Java programs.

Class files compiled with the Windows JDK run on the JRE on any operating system, you don't need to recompile them. So yes, you can compile your Java source code on Windows and run the class files on Linux (provided you're using the correct JDK/JRE versions).

There is a specific JDK and JRE for each operating system. You cannot use the JDK and JRE for Windows on Linux.
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Another way to explain it:

The JVM is *not* part of the operating system (OS). Its OS independence comes from the fact that JVM's have been written for many different OS's. All you have to do is install the one for *your* OS.
 
The only thing that kept the leeches off of me was this 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