Make a java file executable

Asked By 10 points N/A Posted on -
qa-featured

Is it possible to make my java project executable just like what the package and deployment wizard does in visual basic 6.0?

If yes, then how can I do this?

SHARE
Best Answer by Sheldon Ron
Best Answer
Best Answer
Answered By 0 points N/A #102055

Make a java file executable

qa-featured

 

What you need to is that you need to create the .class files from the.java files in the project and keep them in the same directory as the .java files resided in.. in the command prompt type, to create the .class  file. Then try running the .class file containing the main function
javac filename.java 
java filename.class
filename is the file containing the main function. The machine where you will be using the project must have the JVM installed. The .class files will be interpreted for the executable to be run.
.class file is an intermediate file that has the necessary for the linking to the JVM. The JVM platform will enable the java application.
Thanks
Answered By 0 points N/A #102056

Make a java file executable

qa-featured

Hello,

What you have to know is that in Java there are no executable files such as ".exe" to run your project like in other languages.

We have the ".jar" file which is an archive file for your project that can be run just like the ".exe" file .

To generate a JAR file with Eclipse IDE follow these steps :

 

Then you have to generate a Manifest file to run by double click,  follow this : 

 

 

Login/Register to Answer

Related Questions