Results 1 to 8 of 8
- 08-11-2011, 05:31 PM #1
Member
- Join Date
- Aug 2011
- Posts
- 71
- Rep Power
- 0
Creating .jar File - .jar doesnt do anything
hey guys,
i have a problem with the .jar file..
if i run the void main(String args[]) method of my main class: Start everything is working fine , and i got my programm were i can click my buttons, load images etc.
but when i create a .jar file , with Start class as main class, it takes a while until it's done and the .jar is at the folder i chose. but now if i click on the .jar... it loads for 1 sekond and then nothing happens...
do you have any idea why this could be?...
(i work with blueJ if that might be usefull)
Java Code:public class Start { public Start() { } public static void main(String[] agrs) { Editor e = new Editor(); } }Last edited by Coold0wn; 08-11-2011 at 05:35 PM.
- 08-11-2011, 06:19 PM #2
Check if there are errors:
Open a command prompt, change to the folder with your jar file and enter: java -jar <YOURJARFILENAME>.jar
To copy the contents of the command prompt window:
Click on Icon in upper left corner
Select Edit
Select 'Select All' - The selection will show
Click in upper left again
Select Edit and click 'Copy'
Paste here.
- 08-11-2011, 06:26 PM #3
Member
- Join Date
- Aug 2011
- Posts
- 71
- Rep Power
- 0
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten.
C:\Users\Julian>cd desktop
C:\Users\**\Desktop>cd JumpNRunner
C:\Users\**\Desktop\JumpNRunner>cd JumpNrunReadytoplay
C:\Users\**\Desktop\JumpNRunner\JumpNrunReadytopla y>java -jar JumpNrun.jar
Der Befehl "java" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
(= the command "java" is either written wrong or could not be found.)
C:\Users\**\Desktop\JumpNRunner\JumpNrunReadytopla y>
...
edit:
i can open the .jar files of my older versions of the program.
but with the new ones... it doesnt work anymore.
and i can also create new .jar files with my older versions, which are able to run.
i tried to open a old projekt and change everything so it would be like my new one... but then it didnt work anymore...
- 08-11-2011, 06:32 PM #4
Your java installation hasn't put the java command where it can be found by the OS.
For testing you can use the full path. Find the location of the java.exe file and use that vs just java. For example:
C:\Java\jdk_???_?\bin\java.exe -jar JumpNrun.jar
- 08-11-2011, 06:53 PM #5
Member
- Join Date
- Aug 2011
- Posts
- 71
- Rep Power
- 0
i found my Java at c:\Program Files(x86)\Java .. but i cant run the java.exe in the bin folder, because there is " " (space) after Program
... and if i just run the java.exe it wont do anything
edit: i dont even know if there is an error... to me it seems like the .jar file just wouldnt do anything...
and there is no error if i run the program via BlueJ..
and the images i have, are in the folder with the .jar too
ok it worked.. a friend of mine helped me:
Java Code:Microsoft Windows [Version 6.1.7600] Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten. C:\Users\***>cd C:\Program Files (x86)\Java\jre6\bin C:\Program Files (x86)\Java\jre6\bin>java.exe -jar C:\Users\Julian\Desktop\JumpN Runner\JumpNrunReadytoplay\JumpNrun.jar Exception in thread "main" java.lang.IllegalArgumentException: Width (-1) and he ight (-1) cannot be <= 0 at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknow n Source) at java.awt.image.BufferedImage.<init>(Unknown Source) at PickATile.toBufferedImage(PickATile.java:108) at PickATile.ImageToBufferedImage(PickATile.java:101) at PickATile.<init>(PickATile.java:33) at PickATileset.<init>(PickATileset.java:72) at Editor.<init>(Editor.java:32) at Start.main(Start.java:11) C:\Program Files (x86)\Java\jre6\bin>Last edited by Coold0wn; 08-11-2011 at 07:05 PM.
- 08-11-2011, 07:06 PM #6
Member
- Join Date
- Aug 2011
- Posts
- 71
- Rep Power
- 0
aaaaah nice!! thanks! now i know where the mistake comes from!!: )
i have to remember how to do that... :)
thanks a lot, youre hero =)
- 08-11-2011, 07:26 PM #7
Width (-1) and height (-1) cannot be <= 0
...
at PickATile.toBufferedImage(PickATile.java:108)
So you've solved the problem?
- 08-11-2011, 08:28 PM #8
Member
- Join Date
- Aug 2011
- Posts
- 71
- Rep Power
- 0
Similar Threads
-
Not able to delete the file from the temp location after creating a zip file.
By renu in forum New To JavaReplies: 2Last Post: 05-26-2011, 05:38 AM -
Export jar file eclipse doesnt work no more?
By Addez in forum New To JavaReplies: 7Last Post: 03-14-2011, 10:45 AM -
Applet doesnt start or it doesnt show
By 3dprogger in forum Java AppletsReplies: 2Last Post: 01-07-2011, 07:03 PM -
Method Doesnt turn negative number 0 and doesnt return 3
By anonb in forum New To JavaReplies: 7Last Post: 09-28-2010, 12:17 AM -
java.util.Formatter doesnt seem to create a file for me incase I dont have one..
By Addez in forum New To JavaReplies: 10Last Post: 11-01-2009, 09:42 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks