• 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

Run anywhere

 
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can execute a class file into a computer java 1.X not installed with it?
I mean, to run a class file you type in command promt the following:
java MyClassFile
but if jdk1.X not installed in the computer, the (java MyClassFile) will not recognize.
So, What it means compile once, run anywhere?
is it necessary to install JDK1.X?
thanks
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can't, unless you have the Java Virtual Machine installed on the computer you want to run the class on.
COMPILE ONCE means the program is compiled into bytecode that is in a .class file.

'RUN ANYWHERE' means that a Java .class file will run on any machine PROVIDED that machine has the Java Virtual Machine installed on it.
Sun makes the JVM for many different platforms available for free download. It's called RTE, or Run-Time Environment, which among other things, contains the JVM.
The JVM just sits there doing nothing until you type 'java myclassfile' on the command line.
Cool, ain't it?
 
Steve Schowiak
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I forgot to mention:
The JDK or SDK is a download from Sun that will give you all the command-line tools to compile, run, document, and debug Java programs.
The RTE is a download that provides tools that work in the background when your web browser is running, so you can see applets and stuff. It also has the java command that lets you run class files from the command line.
The Sun 1 Studio is a seperate download that has a cool IDE in it. It includes the JDK/SDK.
 
Space pants. 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