Results 1 to 9 of 9
Thread: Jar File doesn't do anything
- 07-18-2011, 03:32 AM #1
Member
- Join Date
- Jul 2011
- Posts
- 4
- Rep Power
- 0
Jar File doesn't do anything
Okay i think i have finally figured out how to generate my manifest file for my jar file in eclipse. But now when i try to run the program, nothing happens. I double click the program and nothing happens at all. I just want to get my program to run without the IDE and its causing me so much trouble!!!! Please help!
Last edited by MiniatureBeast; 07-18-2011 at 03:45 AM.
- 07-18-2011, 03:44 AM #2
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,609
- Rep Power
- 5
Go to the command line and run your jar from there (java -jar myjarname.jar) - it will give a specific exception should there be an error that occurred. Post the full error message here if it doesn't make sense.
- 07-18-2011, 04:02 AM #3
Member
- Join Date
- Jul 2011
- Posts
- 4
- Rep Power
- 0
I plugged what you said into the command prompt and it said: unable to access jarfile helloworld.jar
also i saved my jar file to my desktop if that means anything...Last edited by MiniatureBeast; 07-18-2011 at 04:06 AM.
- 07-18-2011, 09:33 PM #4
Moderator
- Join Date
- Jul 2010
- Location
- California
- Posts
- 1,609
- Rep Power
- 5
Did you cd to the directory where the jar is so java can find it?
- 08-10-2011, 12:57 PM #5
Member
- Join Date
- Aug 2009
- Location
- Ndola, Zambia
- Posts
- 3
- Rep Power
- 0
Am facing the same problem in my new java adventure. I created a new GUI app with eclipse. It runs well in eclipse but when exported as java file it not running in windows.Please advise.
- 08-10-2011, 01:37 PM #6
Now how did you export as java file?It runs well in eclipse but when exported as java file it not running in windows.
db
- 08-10-2011, 02:43 PM #7
Member
- Join Date
- Sep 2008
- Posts
- 13
- Rep Power
- 0
- 08-10-2011, 04:48 PM #8
What OS are you on? Telling the OS what to do when a file is double click is unique to each OS.
On Windows you need an entry in the Registry for the .jar extension that contains the command line to be used when the file is opened. Here are some instructions for how to look at it:
Open Windows Explorer
Click on Tools menu
Click on Folder Options
Select File Types tab
Scroll down in the "Registered file types:" list until you see an entry for JAR.
Select the JAR entry.
Click the Advanced button
In the Edit File Type window scroll down the list of Actions until you see the one in bold.
Select the bold one (The default)
Click the Edit button
Select, Copy and paste here what is in the "Application used to perform action:" window.
Be careful not to change anything and Cancel your way out of the open windows.
Here is what is in mine:
D:\Java\jdk1.6.0_25\jre\bin\javaw.exe -jar "%1"
- 08-10-2011, 10:31 PM #9
Member
- Join Date
- Sep 2008
- Posts
- 13
- Rep Power
- 0
Thank you Norm!
Though on my windows XP version things were slightly different, BUT I associated the JAR file with the path to my javaw.exe file (based on your instructions) and then I noticed the description changed to executable Jar File. Then I was indeed able to double click and launch my Java program just like an exe file.
Rob
Similar Threads
-
Load a file doesn't start a timer
By warchieflll in forum Advanced JavaReplies: 13Last Post: 02-03-2011, 08:34 PM -
why this doesn't work?
By hitesh_public in forum New To JavaReplies: 5Last Post: 08-09-2010, 08:07 AM -
Frame doesn't appear
By SarahB in forum AWT / SwingReplies: 3Last Post: 12-27-2009, 08:36 AM -
Why doesn't this work?
By Corder10 in forum New To JavaReplies: 1Last Post: 07-04-2009, 10:33 PM -
Console doesn't appear!
By PeteMarsh in forum New To JavaReplies: 2Last Post: 12-17-2007, 05:41 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks