I have the same trouble all the time; that's why I prefer Linux.
Originally Posted by zobayer1
But, to answer your question, here's some steps that I performed to compile and run a simple program on Windoze:
Compile Java code:
public class Example
public static void main(String args)
System.out.println("This is a simple program.");
Use your favorite editor to create the manifest file (manifest.mf) with these contents:
Build the JAR file
Execute the JAR file:
"%JAVA_HOME%\bin\jar" cfm Example.jar manifest.mf Example.class
I hope this helps.
"%JAVA_HOME%\bin\java" -cp Example.jar Example
P.S. You should ensure that JAVA_HOME is defined in your environment. The commands above are quoted to guard against the possibility that JAVA_HOME is defined to be in a folder that contains a white-space in the name (e.g. Program Files).