i'm trying to make a exe file for a friend who doesn't have java compiler installed on their computer. i'm using java launcher, and it asks for the class file, and then it asks for the output file which i don't know what it is.
Printable View
i'm trying to make a exe file for a friend who doesn't have java compiler installed on their computer. i'm using java launcher, and it asks for the class file, and then it asks for the output file which i don't know what it is.
You do not need a Java compiler to run Java, you just need the JDK, which everyone should have instead because it is needed for Applets on the Web.
If he or she does not have a JDK just tell him ever to install it, shouldn't be a problem.
Then just make a .jar and tell him to run it using:
java -jar JARFILE
(I don't know if it is added to the Windows Register yet at the installation of Java)
I've not used “java launcher”, but my guess is:
Your class file should be your class file you run to start the program (or .jar file?).
And your output file is PROGRAM_ALIAS.exe
Your friend doesn't need JDK. He should have the JRE (Java Runtime Env.) which is this one Download Free Java Software
Maybe you could use any of these JSmooth - Java Executable Wrapper http://winrun4j.sourceforge.net/
Oh, right...
Sorry!
ok i created the jar file, but it's in a zip file so i fix the files association. when i tried to run it, it says "could not find the main class......"
so now i've tried jsmooth, and when i tried to run the program, it gives me the same error message. the program is tested and is a simple gui program that prints a simple sentence. what's going on?
I'm not sure, but I think that is what we are tring to fix at
http://www.java-forums.org/advanced-...-myself-2.html
I have posted what if think is a working solution in your case.
Here the post I think will fix it:
Can you extract (unzip) the jar file (using 7-zip, WinZip or whatever)
and try to run your main class.
Does there exist a manifest file, by standard named
META-INF/MANIFEST.MF
If does there exist a line beginning with "Main-Class: " and does it say
Main-Class: FULLY_QUALIFIED_MAIN_CLASS_NAME
Create a manifest file META-INF/MANIFEST.MF
Fill it this data:
And rebuild your jar file:Code:Manifest-Version: FILL_IN
Package-Version: FILL_IN
Product-Name: FILL_IN
Package-Vendor: FILL_IN
Created-By: FILL_IN
Main-Class: FILL_IN
Class-Path: WHITESPACE_SEPARATED_JAR_FILES
cd PATH_WITH_FILES
jar cfm META-INF/MANIFEST.MF **
on jsmooth, it says java is not found on my computer.
If you open the command prompt and type
java -version
and it does not print your version of Java, this
should do the trick, otherwise I do not think I can help you.
http://post.dyndns.org/image2-00.png
http://post.dyndns.org/image2-01.png
http://post.dyndns.org/image2-02.png
http://post.dyndns.org/image2-03.png
http://post.dyndns.org/image2-04.png
Now you append (add) the the folder you installed Java to:
http://post.dyndns.org/image2-05.png
I think the path should end with \bin
Then you click 'OK' on all opened windows.
yes there is a META-INF folder and a MANIFEST.MF file inside of it.
and there isn't a Main-Class: FULLY_QUALIFIED_MAIN_CLASS_NAME
when i extract it, it only has the "program.class" and the META-INF folder.
it does print out the java version..."1.6.0_20"
If there is no Main-Class entry Java will not know what class to run.
it has the "program.class" file in it which is the main class, is that it?
what the?? my pc is pretty new. that's weird, i'll download the latest version...
Yes.
Add
Main-Class: program
to your manifest.
Also you should not use lower case on the first letter on class names.
Rename the class to Program and source file to Program.java and recompile.
If your class is named Program Add
Main-Class: Program
to your manifest.
Since you are running Windows, casing on files will have no effect, but I would recommend to fix the casing.
ok i installed the latest version, and jsmooth is still telling me that java is not found on my computer...
stupid question but what's a manifest?
And you updated your manifest with a Main-Class entity?
I'll need to shutdown my computer now and try to resurrect my graphics card,
and maybe go into hibernation (not my computer), if so; hope you'll get it working, otherwise I'll be online tomorrow.
It's your MANIFEST.MF file inside the META-INF folder.
It content should be similar to
[/code]
Manifest-Version: FILL_IN
Package-Version: FILL_IN
Product-Name: FILL_IN
Package-Vendor: FILL_IN
Created-By: FILL_IN
Main-Class: FILL_IN
Class-Path: WHITESPACE_SEPARATED_JAR_FILES
[code]
See my earlier post if you need to create one.