Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2011
    Posts
    4
    Rep Power
    0

    Default 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.

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    7

    Default

    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.

  3. #3
    Join Date
    Jul 2011
    Posts
    4
    Rep Power
    0

    Default

    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.

  4. #4
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    7

    Default

    Did you cd to the directory where the jar is so java can find it?

  5. #5
    skahilu is offline Member
    Join Date
    Aug 2009
    Location
    Ndola, Zambia
    Posts
    3
    Rep Power
    0

    Default

    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.

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,242
    Rep Power
    19

    Default

    It runs well in eclipse but when exported as java file it not running in windows.
    Now how did you export as java file?

    db

  7. #7
    Zrob is offline Member
    Join Date
    Sep 2008
    Posts
    13
    Rep Power
    0

    Default

    Quote Originally Posted by doWhile View Post
    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.
    I am also having issues running my jar file. I can run it using the cmd line above but not by double clicking the jar. I have tried a few instructions found on this site with no luck. I am using Eclipse Version: 3.7.0 on windows XP.

  8. #8
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,421
    Rep Power
    25

    Default

    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"

  9. #9
    Zrob is offline Member
    Join Date
    Sep 2008
    Posts
    13
    Rep Power
    0

    Thumbs up

    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

  1. Load a file doesn't start a timer
    By warchieflll in forum Advanced Java
    Replies: 13
    Last Post: 02-03-2011, 08:34 PM
  2. why this doesn't work?
    By hitesh_public in forum New To Java
    Replies: 5
    Last Post: 08-09-2010, 08:07 AM
  3. Frame doesn't appear
    By SarahB in forum AWT / Swing
    Replies: 3
    Last Post: 12-27-2009, 08:36 AM
  4. Why doesn't this work?
    By Corder10 in forum New To Java
    Replies: 1
    Last Post: 07-04-2009, 10:33 PM
  5. Console doesn't appear!
    By PeteMarsh in forum New To Java
    Replies: 2
    Last Post: 12-17-2007, 05:41 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •