.jar file not working
Author |
Message |
wonsleved
|
Posted: Tue Dec 05, 2006 3:33 pm Post subject: .jar file not working |
|
|
i cant run the .jar file i made for my program, i was hoping someone could give some suggestions for why this would happen. my html code is:
<applet code=class1.class
archive="javaproject.jar"
width=800 height=600>
</applet>
the applet will load to 99% and then stop, so i dont know what the problem could be. please help
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
gsquare567
|
Posted: Tue Dec 05, 2006 4:08 pm Post subject: (No subject) |
|
|
make sure you typed in:
code: | jar cvfm [i]JarFileName.jar ManifestFileName.txt[/i] *.* |
if you did include a manifest, then make sure it looks like this:
code: | Main-Class: [i]ClassName[/i]
|
note there is not ".class" extension there, and there is a blank line after it, and the manifest must also be made in a regular text file. please post all your jar-related files if it still doesnt work.[/i]
|
|
|
|
|
|
wonsleved
|
Posted: Tue Dec 05, 2006 4:25 pm Post subject: (No subject) |
|
|
where do i put that code?
|
|
|
|
|
|
gsquare567
|
Posted: Tue Dec 05, 2006 6:10 pm Post subject: (No subject) |
|
|
ok, heres a quick tut on how to make a simple jar file + html file:
if you have more than one class, or even if you dont, its a good idea to include a manifest. that is just a simple text file that you name something like manifest, and hasta include the text "Main-Class: " + ClassName. note that you do not include the ".class" extension. after that, include a blank line, so hit return twice. save it and put it in the same folder as ur class files. next is actually creating the jar. go to command prompt, type cd DirectoryName of your files that are needed in the jar until you reach the folder you need with all the components in it, and type "jar cvfm JarFileName.jar ManifestFileName.txt *.*" then press enter. it should say "added " + file for every file in the directory. be sure to do that EXACTLY. after, make a html file by naming a .txt file .html, and include the following code: (this is not case-sensitive)
code: |
<HTML>
<CENTER>
<APPLET
code = "ClassName.class"
archive = JarName.jar
width = "600"
height = "800"
>
</APPLET>
</CENTER>
</BODY>
</HTML>
|
now just run the html file and your applet should load and play if everything is in the same folder. but i cannot stress this enough. make it in the same folder lol. also be sure to make the manifest a plain text file, not in ms word, just plain text, and make it exactly as i wrote, just substitute the ClassName with the actual class name. your welcome.
|
|
|
|
|
|
wonsleved
|
Posted: Wed Dec 06, 2006 5:59 pm Post subject: (No subject) |
|
|
ok i added the manifest but it still wont work. i know that its getting into the main class because i can hear music playing and it has to get into init() to do that. i have the same problem when i put applets on the web, they will load fully, play the music, but it still sais loading 99%. this happens with all the applets i try to put on the web so im pretty sure it doesnt have to do with my code. im totoally stumped here, someone please help.
|
|
|
|
|
|
gsquare567
|
Posted: Wed Dec 06, 2006 6:59 pm Post subject: (No subject) |
|
|
go to [url]java.sun.com[/url] and download the latest version of the jse, now i believe its at update 10. it may only go to 99% because u havent installed the plug-in required for the things you are using. otherwise, i cant help you. im also having a problem with an applet, but i've used applets b4 so iunno.
|
|
|
|
|
|
wonsleved
|
Posted: Wed Dec 06, 2006 7:26 pm Post subject: (No subject) |
|
|
hmm, that didnt seem to work either, applets seem to stop working once they get to big, thaks for your help though.
|
|
|
|
|
|
xxbow-pkerxx
|
Posted: Thu Jan 18, 2007 9:07 pm Post subject: Re: .jar file not working |
|
|
can some on help me
im trying to make a manifest file for the executable jar file i want to make but i keep getting an error
about invalid header field and some other stuff
can some on tell me what code i need to put in to cmd.exe right now i was putting
jar cfm test.jar manifest.txt *.class
i know my program works and everything can some on please help me my class with the main method is called cube.class
Description: |
|
Download |
Filename: |
manifest.txt |
Filesize: |
20 Bytes |
Downloaded: |
132 Time(s) |
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
|
|