how to convert a java program into an exe
Page 1 of 1
how to convert a java program into an exe
#1
Posted 03 November 2008 - 07:06 AM
i have done my project in java and C bridgeing through JNI, now it is asked that i give my project a complete software look, so that i could start it "just by clicking the icon with a mouse". is that possible?
i have many sites but everywhere i got it is not possible. If it is possible can any body show me the way please.
i have many sites but everywhere i got it is not possible. If it is possible can any body show me the way please.
#3
Posted 03 November 2008 - 07:31 AM
i have done all this:
create manifest file
in that manifest file you have to mention your main class name like below.
Manifest-Version: 1.0
Specification-Title: Java Utility Classes
Created-By: 1.5.0 (Sun Microsystems Inc.)
Main-Class: mainclassname(project)
and save it as manifest.mf and keep this file in project location.
and then you have to run the following command in DOS prompt
(go to projetlocation via command prompt)
jar cmf manifest.mf filename.jar *.*
but it is giving file not found exception and also the native method that i am using not found.
create manifest file
in that manifest file you have to mention your main class name like below.
Manifest-Version: 1.0
Specification-Title: Java Utility Classes
Created-By: 1.5.0 (Sun Microsystems Inc.)
Main-Class: mainclassname(project)
and save it as manifest.mf and keep this file in project location.
and then you have to run the following command in DOS prompt
(go to projetlocation via command prompt)
jar cmf manifest.mf filename.jar *.*
but it is giving file not found exception and also the native method that i am using not found.
#6
Posted 04 November 2008 - 07:10 AM
#7
Posted 04 November 2008 - 08:10 AM
Also in the manifest file if your program needs to reference any external jar files you to add the Class-Path header.
Also if you want to create a desktop shortcut you can do this by right clicking on the desktop and in the new menu click shortcut. Specify the jar file in the field provided, and click next and enter the name ten click finish. Then you need to right click on the shortcut and click properties. In the target box is the name of the jar file. You must specify the command to run the file here. The command would be something like:
"<dir-Path>/javaw.exe" –jar "<jar-File>"
where <dir-Path> is the path to the java bin directory and <jar-File> is the jar file to run.
Also if you want to create a desktop shortcut you can do this by right clicking on the desktop and in the new menu click shortcut. Specify the jar file in the field provided, and click next and enter the name ten click finish. Then you need to right click on the shortcut and click properties. In the target box is the name of the jar file. You must specify the command to run the file here. The command would be something like:
"<dir-Path>/javaw.exe" –jar "<jar-File>"
where <dir-Path> is the path to the java bin directory and <jar-File> is the jar file to run.
#8
Posted 04 November 2008 - 10:52 AM
you could always have a batch file in the same directory....
say your file is not a .jar but a .class and you have Main.java ( Main.class after compliling) well you could create a batch file
and save it as anything.bat then once u can just double click on the file and it will open cmd and execute the command.
say your file is not a .jar but a .class and you have Main.java ( Main.class after compliling) well you could create a batch file
java Main
and save it as anything.bat then once u can just double click on the file and it will open cmd and execute the command.
#9
Posted 04 November 2008 - 05:11 PM
mdew_47, on 4 Nov, 2008 - 04:09 AM, said:
i have solved my problem, i have been able to create an executable jar file.
Wouldn't call a .jar as an executable.... your topic title is misleading
as Lordms mentionned their are a few programs in the web. I personnaly use Exe4J since years without problem (more than 2 thousand deployments)
Page 1 of 1

Start a new topic
Add Reply




MultiQuote


| 


