Results 1 to 20 of 31
Thread: how to use java launcher?
- 12-28-2010, 11:48 PM #1
Member
- Join Date
- Sep 2010
- Posts
- 32
- Rep Power
- 0
- 12-29-2010, 12:58 AM #2
- Join Date
- Dec 2010
- Location
- Stockholm, Sweden
- Posts
- 222
- Blog Entries
- 9
- Rep Power
- 3
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
- 12-29-2010, 01:20 AM #3
Member
- Join Date
- Dec 2010
- Posts
- 5
- Rep Power
- 0
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/Last edited by latinoNJ; 12-29-2010 at 01:26 AM.
- 12-29-2010, 01:30 AM #4
- Join Date
- Dec 2010
- Location
- Stockholm, Sweden
- Posts
- 222
- Blog Entries
- 9
- Rep Power
- 3
Oh, right...
Sorry!
- 12-29-2010, 03:04 AM #5
Member
- Join Date
- Sep 2010
- Posts
- 32
- Rep Power
- 0
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?Last edited by plasticfood; 12-29-2010 at 03:17 AM.
- 12-29-2010, 03:19 AM #6
- Join Date
- Dec 2010
- Location
- Stockholm, Sweden
- Posts
- 222
- Blog Entries
- 9
- Rep Power
- 3
I'm not sure, but I think that is what we are tring to fix at
Doesn't anyone here know how to help? I feel like I wanna hang myself
I have posted what if think is a working solution in your case.Ex animo! Hibernate
Java, Arch Linux, C, GPL v3, Bash, Eclipse, Linux VT, GNOME 2 and many buttons on windows.
- 12-29-2010, 03:29 AM #7
- Join Date
- Dec 2010
- Location
- Stockholm, Sweden
- Posts
- 222
- Blog Entries
- 9
- Rep Power
- 3
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:Java 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 **Ex animo! Hibernate
Java, Arch Linux, C, GPL v3, Bash, Eclipse, Linux VT, GNOME 2 and many buttons on windows.
- 12-29-2010, 03:32 AM #8
Member
- Join Date
- Sep 2010
- Posts
- 32
- Rep Power
- 0
on jsmooth, it says java is not found on my computer.
- 12-29-2010, 03:39 AM #9
- Join Date
- Dec 2010
- Location
- Stockholm, Sweden
- Posts
- 222
- Blog Entries
- 9
- Rep Power
- 3
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.Ex animo! Hibernate
Java, Arch Linux, C, GPL v3, Bash, Eclipse, Linux VT, GNOME 2 and many buttons on windows.
- 12-29-2010, 03:40 AM #10
Member
- Join Date
- Sep 2010
- Posts
- 32
- Rep Power
- 0
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"Last edited by plasticfood; 12-29-2010 at 03:42 AM.
- 12-29-2010, 03:43 AM #11
- Join Date
- Dec 2010
- Location
- Stockholm, Sweden
- Posts
- 222
- Blog Entries
- 9
- Rep Power
- 3
If there is no Main-Class entry Java will not know what class to run.
Ex animo! Hibernate
Java, Arch Linux, C, GPL v3, Bash, Eclipse, Linux VT, GNOME 2 and many buttons on windows.
- 12-29-2010, 03:44 AM #12
Member
- Join Date
- Sep 2010
- Posts
- 32
- Rep Power
- 0
it has the "program.class" file in it which is the main class, is that it?
- 12-29-2010, 03:44 AM #13
- Join Date
- Dec 2010
- Location
- Stockholm, Sweden
- Posts
- 222
- Blog Entries
- 9
- Rep Power
- 3
- 12-29-2010, 03:45 AM #14
Member
- Join Date
- Sep 2010
- Posts
- 32
- Rep Power
- 0
what the?? my pc is pretty new. that's weird, i'll download the latest version...
- 12-29-2010, 03:47 AM #15
- Join Date
- Dec 2010
- Location
- Stockholm, Sweden
- Posts
- 222
- Blog Entries
- 9
- Rep Power
- 3
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.Last edited by Hibernate; 12-29-2010 at 03:52 AM.
Ex animo! Hibernate
Java, Arch Linux, C, GPL v3, Bash, Eclipse, Linux VT, GNOME 2 and many buttons on windows.
- 12-29-2010, 03:49 AM #16
- Join Date
- Dec 2010
- Location
- Stockholm, Sweden
- Posts
- 222
- Blog Entries
- 9
- Rep Power
- 3
- 12-29-2010, 03:55 AM #17
Member
- Join Date
- Sep 2010
- Posts
- 32
- Rep Power
- 0
ok i installed the latest version, and jsmooth is still telling me that java is not found on my computer...
- 12-29-2010, 03:59 AM #18
Member
- Join Date
- Sep 2010
- Posts
- 32
- Rep Power
- 0
stupid question but what's a manifest?
- 12-29-2010, 03:59 AM #19
- Join Date
- Dec 2010
- Location
- Stockholm, Sweden
- Posts
- 222
- Blog Entries
- 9
- Rep Power
- 3
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.Ex animo! Hibernate
Java, Arch Linux, C, GPL v3, Bash, Eclipse, Linux VT, GNOME 2 and many buttons on windows.
- 12-29-2010, 04:01 AM #20
- Join Date
- Dec 2010
- Location
- Stockholm, Sweden
- Posts
- 222
- Blog Entries
- 9
- Rep Power
- 3
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.Ex animo! Hibernate
Java, Arch Linux, C, GPL v3, Bash, Eclipse, Linux VT, GNOME 2 and many buttons on windows.
Similar Threads
-
Java(TM) Web Start Launcher doesn't work after a software update for some users
By Richard Gillespie in forum Advanced JavaReplies: 0Last Post: 12-21-2010, 03:21 PM -
Java Launcher and Applets
By Bomber_Will in forum Java AppletsReplies: 2Last Post: 01-15-2010, 12:41 AM -
JVM launcher?
By manoj.maniraj in forum Advanced JavaReplies: 1Last Post: 04-06-2009, 11:30 PM -
writing a program launcher (or Timer)
By Farzaneh in forum Threads and SynchronizationReplies: 3Last Post: 02-17-2009, 09:00 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks