Results 1 to 14 of 14
  1. #1
    Dalex is offline Member
    Join Date
    Mar 2012
    Posts
    8
    Rep Power
    0

    Default .jar extension trouble

    Hello I'm new to the Java world so please have some patience with me while I learn the basics.
    Recently I installed some new stuff on my PC and after that I found out that I can't execute .jar files anymore.
    I knew that the problem was in file type association so I tried to set it manualy.
    When that didn't work I tried to set it using Creative Element Power Tools, which again didn't work.
    Then I tried full reinstallation of Java enviroment and I'am still where I started.
    I have attached a screenshot so you can see current state of things.

    .jar extension trouble-file.png

    Thank you for your advice. Dalex

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,820
    Rep Power
    19

    Default Re: .jar extension trouble

    WHat happens when you do:
    <path to>\javaw -jar <your jar file>
    from a command line, in the directory where your jar file is located?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  4. #4
    Dalex is offline Member
    Join Date
    Mar 2012
    Posts
    8
    Rep Power
    0

    Default Re: .jar extension trouble

    Quote Originally Posted by Eranga View Post
    What happen when you double click on the jar file?
    Nothing, simple as that.
    Last edited by Dalex; 03-06-2012 at 04:26 PM.

  5. #5
    Dalex is offline Member
    Join Date
    Mar 2012
    Posts
    8
    Rep Power
    0

    Default Re: .jar extension trouble

    WHat happens when you do:
    <path to>\javaw -jar <your jar file>
    from a command line, in the directory where your jar file is located?

    Yeah I had to change directory of my Java installation for it to work. But yes, then it actually executes.
    But when I tried to change path to javaw in CEPT it still did not work.
    Last edited by Dalex; 03-06-2012 at 06:46 PM.

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default Re: .jar extension trouble

    By right-click on your jar file see the exact file association is the correct one.

  7. #7
    Dalex is offline Member
    Join Date
    Mar 2012
    Posts
    8
    Rep Power
    0

    Default Re: .jar extension trouble

    Quote Originally Posted by Eranga View Post
    By right-click on your jar file see the exact file association is the correct one.
    Yes it is associated with javaw.exe with parametr -jar.

  8. #8
    Dalex is offline Member
    Join Date
    Mar 2012
    Posts
    8
    Rep Power
    0

    Default Re: .jar extension trouble

    C'mon can't anyone help me?
    Does anyone have any idea how to fix this?

  9. #9
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,820
    Rep Power
    19

    Default Re: .jar extension trouble

    Quote Originally Posted by Dalex View Post
    Yeah I had to change directory of my Java installation for it to work. But yes, then it actually executes.
    But when I tried to change path to javaw in CEPT it still did not work.
    What does that bit in bold mean?
    Did it not work with the path used in the extension mapping?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  10. #10
    Dalex is offline Member
    Join Date
    Mar 2012
    Posts
    8
    Rep Power
    0

    Default Re: .jar extension trouble

    Quote Originally Posted by Tolls View Post
    What does that bit in bold mean?
    Did it not work with the path used in the extension mapping?
    Well I tried to run it from cl and it did not work so I relocated main java directory from:"C:\Program Files\Java" to "C:\Java" and I also changed path to javaw.exe in CEPT.
    Then I could open it from the cl but I still cant open it buy double click or by rightclick + open.
    So Im basicly where I began.

  11. #11
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,820
    Rep Power
    19

    Default Re: .jar extension trouble

    If it didn't work running from where Java was originally located in the 'C:\Program Files\Java' then I suspect that's your problem.
    What are the contents of that directory?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  12. #12
    Dalex is offline Member
    Join Date
    Mar 2012
    Posts
    8
    Rep Power
    0

    Default Re: .jar extension trouble

    Quote Originally Posted by Tolls View Post
    If it didn't work running from where Java was originally located in the 'C:\Program Files\Java' then I suspect that's your problem.
    What are the contents of that directory?
    Contensts of Java folder are: jre7 and jdk1.7.0_03 nothing else.
    Also even after I changed directory I still cat open .jar files by double click.
    Changing path works only for command line.

  13. #13
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,820
    Rep Power
    19

    Default Re: .jar extension trouble

    I just get the impression you've shifted a load of Java stuff around now, which makes it almost impossible to figure out what the problem might have been.
    Things like "I relocated main java directory" make me flinch.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  14. #14
    Dalex is offline Member
    Join Date
    Mar 2012
    Posts
    8
    Rep Power
    0

    Default Re: .jar extension trouble

    Quote Originally Posted by Tolls View Post
    I just get the impression you've shifted a load of Java stuff around now, which makes it almost impossible to figure out what the problem might have been.
    Things like "I relocated main java directory" make me flinch.
    Yes I've relocated it because it did not work from it's original path.
    And it actualy did solve my problem partialy because now I can play .jar files via command line.
    But because I want to make it completely clear to everyone I've returned it now to it's original place where it was installed.

Similar Threads

  1. Extension problem using JFileChooser
    By JavaFan in forum New To Java
    Replies: 1
    Last Post: 12-22-2011, 04:44 AM
  2. Text file extension?
    By chrisLU5 in forum New To Java
    Replies: 4
    Last Post: 05-14-2011, 12:20 AM
  3. Help with creating an instance of a class extension
    By Inferno719 in forum New To Java
    Replies: 19
    Last Post: 05-04-2011, 03:53 AM
  4. File Extension Filter
    By heartysnowy in forum New To Java
    Replies: 9
    Last Post: 10-09-2010, 01:33 PM
  5. Regex for file extension
    By gapper in forum New To Java
    Replies: 1
    Last Post: 01-31-2008, 03:59 PM

Posting Permissions

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