|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Run a Java program from a .exe
Is there any way to get a Java program to execute from a .exe file? I'm trying to package a Java program so that I can just click on it to run it, and more importantly my dad can just click on it to run it. I don't care if it actually compiles the program to machine code (I'm not sure that is possible) or simply hides the details of the execution.
|
|
#2
|
||||
|
||||
|
Google for "executable JAR".
~
__________________
Yawmark class Sig{public static void main(String...args){\u0066or(int \u0020$:"vÌÈÊ\"¤¾Àʲ¬Æ\"v¤Î¤\"²¤¨¸¬Æ".to\u0043h\u0061rArray() )System./*goto/*$/%\u0126//^\u002A\u002Fout.print((char)(($>> +(~'"'&'#'))+('<'>>('\\'/'.')/\u002Array.const(~1)\*\u002F)));}} |
|
#3
|
|||
|
|||
|
Perfect. Thanks.
|
|
#4
|
|||
|
|||
|
see ,it is possible to develop OR convert java .Class files to .exe files .many softwares are available on internet you can easily download them it is fast and easy as they are in very small size. you can use search engins such as "google","wikipedia","yaho".... just you can use"conveting jar to exe" OR "converting .class to exe" you will get result.
i think you new to java programming. !!!!!! wish you HAPPY PROGRAMMING !!!!!!!!! |
|
#5
|
||||
|
||||
|
Manifest file
Basically it is simply to add a line in the manifest file.
Just add a line in the manifest file like below to make the jar file executable: Main-Class: <full class name >
__________________
When the programming world turns decent, the real world will turn upside down.
|
|
#6
|
|||
|
|||
|
Quote:
@OP: ... and end with a new line in the manifest file! More info: http://www.cs.princeton.edu/introcs...on/jar/jar.html (short) http://java.sun.com/docs/books/tutorial/deployment/jar/ (thorough) |
|
#7
|
|||
|
|||
|
what ever you said is right but what i am saying is that you want a self running programme.
.class-exe OR .jar-.exe converters just pack your class or jar files they onle do is that the execute your class or jar files in exe files.you will always need java runtime environment where ever you use java. just try it i have tried it numerous times you will get whatever you expect.C C++ is different thing in this.dont merge. jarto only exe.it will always need jre. |
|
#8
|
|||
|
|||
|
Code:
D:\Export Zips>java -jar DrainageNetworkVisualizer2.jar
Exception in thread "main" java.lang.NoClassDefFoundError: com/hp/hpl/jena/rdf/m
odel/RDFNode
at DrainageNetworkVisualizer.main(DrainageNetworkVisualizer.java:33)
Caused by: java.lang.ClassNotFoundException: com.hp.hpl.jena.rdf.model.RDFNode
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 1 more
This is the error I get when trying to execute it. I've read through the tutorials listed here and a few others but I am still getting the error. It seems that JBuilder is not including the 3rd-party jars when it is packing my jar. How do I get it to include them? EDIT: It is working now, but I had to add ~50 external jars to the manifest's classpath and package the whole thing into a zip file. Is there any way to distribute that as a single executable .jar? Last edited by spyder0101 : June 26th, 2009 at 05:24 PM. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > Run a Java program from a .exe |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|