I have a java file(hello.java). Then i used javac hello.java to compile it to bytecode. Everytime i must use java hello to run this application. I want to know how can i run it like other windows application by double click it.
Printable View
I have a java file(hello.java). Then i used javac hello.java to compile it to bytecode. Everytime i must use java hello to run this application. I want to know how can i run it like other windows application by double click it.
1) You can create a .bat file that contains the command to launch it.
2) You can create a small .exe that launches it. (I think there are tools that do that.)
3) You can pack it into an executable JAR. With the right file associations, you can just double-click it.
You can use JBuilder (I do) to compile to native languages (windows, dos, unix, mac)
or you can use "NetBeans" it free from sun website, it compiles to exe if you download the windows version
Executable jar, no contest. run the command and then make sure you have the mainfest set up correctly.
How can i know whether the computer have Java Virtual Machine installed or not? It is Java Virtual Machine installed when we installed J2SDK? If i only want to installed Java Virtual Machine to run *.class class, how to install?
Install the JRE to run .class files it's also associated with the JDK
What is JRE? So it means that after i installed JRE, i can use command java. What can i do after i installed JRE?
JRE is the Java Runtime Environment - everything an end user needs to run Java programs.