This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Running Java programs outside of IDE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Running Java programs outside of IDE" Watch "Running Java programs outside of IDE" New topic
Author

Running Java programs outside of IDE

Travis Sobeck
Greenhorn

Joined: Jun 08, 2005
Posts: 1
I can build programs, compile them, and run them in the IDE just fine. The question is, how do I run the program on a machine with JRE without the IDE?
Jeff Langr
author
Ranch Hand

Joined: May 14, 2003
Posts: 762
Use the java executable (java.exe under Windows). Make sure you have a path to the bin directory of your JRE. Then execute something like:



You can set your classpath ahead of time, if necessary, or set it using the -classpath (or -cp) option. For details on the java command, simply enter java at the command line.

-Jeff-


Books: Agile Java, Modern C++ Programming with TDD, Essential Java Style, Agile in a Flash. Contributor, Clean Code.
 
 
subject: Running Java programs outside of IDE