Re: JAR file association on Windows 7 broken

Discussion in 'Java' started by Arne Vajhøj, Jul 1, 2012.

  1. Arne Vajhøj

    Arne Vajhøj Guest

    On 6/30/2012 8:00 PM, Qu0ll wrote:
    > I have somehow managed to break the file association between JAR files
    > and Java on Windows 7 such that I can no longer double click on an
    > executable JAR file. How can I fix it? Reinstalling the JRE has not
    > helped.
    >
    > I can right click on a JAR file and select Open With and then select
    > java.exe but there doesn't seem to be a way to specify that that
    > java.exe needs the -jar command line option to run them and so this
    > doesn't work. It correctly changes the JAR file icon to the Java icon
    > but they still won't open on double click.


    I think it should be javaw and not java.

    And you need to get the command line right.

    http://windowstipoftheday.blogspot.com/2005/10/setting-jar-file-association.html

    https://support.istaria.com/index.php?act=article&code=view&id=55

    should give some hints.

    Arne
     
    Arne Vajhøj, Jul 1, 2012
    #1
    1. Advertising

  2. Arne Vajhøj

    Lew Guest

    Qu0ll wrote:
    > "Arne Vajhøj" wrote in message news:4fef94eb$0$282$...
    >
    > On 6/30/2012 8:00 PM, Qu0ll wrote:
    >> I have somehow managed to break the file association between JAR files
    >> and Java on Windows 7 such that I can no longer double click on an
    >> executable JAR file. How can I fix it? Reinstalling the JRE has not
    >> helped.
    >>
    >> I can right click on a JAR file and select Open With and then select
    >> java.exe but there doesn't seem to be a way to specify that that
    >> java.exe needs the -jar command line option to run them and so this
    >> doesn't work. It correctly changes the JAR file icon to the Java icon
    >> but they still won't open on double click.

    >
    > I think it should be javaw and not java.
    >
    > And you need to get the command line right.
    >
    > http://windowstipoftheday.blogspot.com/2005/10/setting-jar-file-association.html
    >
    > https://support.istaria.com/index.php?act=article&code=view&id=55
    >
    > should give some hints.
    >
    > ----------------------------------
    >
    > Thanks Arne but unfortunately they didn't solve my problem. The first link
    > doesn't apply to Windows 7 and both the utility and command in the second link
    > made no difference (so maybe they don't work in Windows 7 either). So I still
    > cannot double click on executable JAR files. I think once you have chosen
    > "Open with..." it sets the association in concrete. In my case it has
    > remembered an incorrect command and I cannot see any way of overriding it.


    This is a Windows question, not a Java question. Windows has the ability to
    associate command lines with an extension, including options. Look up how.

    "Open with..." is only the common-case shortcut. You need to dig into
    control-panelish options to go beyond it.

    GIYF.

    --
    Lew
    Honi soit qui mal y pense.
    http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg
     
    Lew, Jul 1, 2012
    #2
    1. Advertising

  3. Arne Vajhøj

    Arne Vajhøj Guest

    On 6/30/2012 8:55 PM, Qu0ll wrote:
    > "Arne Vajhøj" wrote in message
    > news:4fef94eb$0$282$...
    >
    > On 6/30/2012 8:00 PM, Qu0ll wrote:
    >> I have somehow managed to break the file association between JAR files
    >> and Java on Windows 7 such that I can no longer double click on an
    >> executable JAR file. How can I fix it? Reinstalling the JRE has not
    >> helped.
    >>
    >> I can right click on a JAR file and select Open With and then select
    >> java.exe but there doesn't seem to be a way to specify that that
    >> java.exe needs the -jar command line option to run them and so this
    >> doesn't work. It correctly changes the JAR file icon to the Java icon
    >> but they still won't open on double click.

    >
    > I think it should be javaw and not java.
    >
    > And you need to get the command line right.
    >
    > http://windowstipoftheday.blogspot.com/2005/10/setting-jar-file-association.html
    >
    >
    > https://support.istaria.com/index.php?act=article&code=view&id=55
    >
    > should give some hints.
    >
    > ----------------------------------
    >
    > Thanks Arne but unfortunately they didn't solve my problem. The first
    > link doesn't apply to Windows 7 and both the utility and command in the
    > second link made no difference (so maybe they don't work in Windows 7
    > either). So I still cannot double click on executable JAR files. I
    > think once you have chosen "Open with..." it sets the association in
    > concrete. In my case it has remembered an incorrect command and I
    > cannot see any way of overriding it.


    http://www.sevenforums.com/tutorials/9154-default-programs-associate-file-type-protocol.html

    Arne
     
    Arne Vajhøj, Jul 1, 2012
    #3
  4. Arne Vajhøj

    Arne Vajhøj Guest

    On 6/30/2012 9:55 PM, Qu0ll wrote:
    > "Arne Vajhøj" wrote in message
    > news:4fefa839$0$295$...
    >
    > On 6/30/2012 8:55 PM, Qu0ll wrote:
    >> "Arne Vajhøj" wrote in message
    >> news:4fef94eb$0$282$...
    >>
    >> On 6/30/2012 8:00 PM, Qu0ll wrote:
    >>> I have somehow managed to break the file association between JAR files
    >>> and Java on Windows 7 such that I can no longer double click on an
    >>> executable JAR file. How can I fix it? Reinstalling the JRE has not
    >>> helped.
    >>>
    >>> I can right click on a JAR file and select Open With and then select
    >>> java.exe but there doesn't seem to be a way to specify that that
    >>> java.exe needs the -jar command line option to run them and so this
    >>> doesn't work. It correctly changes the JAR file icon to the Java icon
    >>> but they still won't open on double click.

    >>
    >> I think it should be javaw and not java.
    >>
    >> And you need to get the command line right.
    >>
    >> http://windowstipoftheday.blogspot.com/2005/10/setting-jar-file-association.html
    >>
    >>
    >>
    >> https://support.istaria.com/index.php?act=article&code=view&id=55
    >>
    >> should give some hints.
    >>
    >> ----------------------------------
    >>
    >> Thanks Arne but unfortunately they didn't solve my problem. The first
    >> link doesn't apply to Windows 7 and both the utility and command in the
    >> second link made no difference (so maybe they don't work in Windows 7
    >> either). So I still cannot double click on executable JAR files. I
    >> think once you have chosen "Open with..." it sets the association in
    >> concrete. In my case it has remembered an incorrect command and I
    >> cannot see any way of overriding it.

    >
    >
    >> http://www.sevenforums.com/tutorials/9154-default-programs-associate-file-type-protocol.html
    >>

    >
    > This does not allow you to specify a command line in the association.
    > It seems to be just another way to get to "Open with...".


    Then back to the command line.

    assoc and ftype do exist in Windows 7.

    C:\>ver

    Microsoft Windows [Version 6.1.7601]

    C:\>assoc jarfile
    jarfile=Executable Jar File

    C:\>ftype jarfile
    jarfile="C:\Program Files (x86)\Java\jre7\bin\javaw.exe" -jar "%1" %*


    Arne
     
    Arne Vajhøj, Jul 1, 2012
    #4
  5. Arne Vajhøj

    Lew Guest

    Qu0ll wrote:
    > "Lew" wrote in message news:jso8qb$aon$...
    >
    > [snip]
    >
    > This is a Windows question, not a Java question. Windows has the ability to
    > associate command lines with an extension, including options. Look up how.
    >
    > "Open with..." is only the common-case shortcut. You need to dig into
    > control-panelish options to go beyond it.
    >
    > GIYF.
    >
    > ------------------------------------------
    >
    > You are such a hard task master Lew. This question may not be directly
    > related to Java _programming_ but it is related to getting Java to work on my
    > machine which is necessary if I want to continue as a Java programmer.


    That's not the point, and I'm not a task master at all. I'm simply pointing
    out that your question is specific to knowledge of Windows, and that this
    forum is not optimal for that topic.

    Just because it's related to Java doesn't mean that Java skills will solve it.
    In this case it takes Windows skills.

    I am so very deeply sorry to speak simple truth here. I assure you that I did
    not do it to offend your sensibilities but to suggest a more propitious approach.

    > Anyway, my Google skills must be a little lacking because I cannot locate any
    > link which tells me how to do this in Windows 7. The File Types tab in
    > Windows Explorer has been removed in Windows 7 and the file type associations
    > option in Control Panel doesn't seem to allow you to specify a command line.


    I don't know if this'll help or not, but if Windows knowledge doesn't solve
    your problem sure as Hell is an icy place the cross-platform, independent
    viewpoint of Java isn't going to do you a spit of good.

    But since you seem all bent out of shape that I profess not to be an expert in
    Windows 7 and that a Windows 7-specific forum might improve your chances of a
    good answer, I felt bad and decided to Google on your behalf. Again, I'm no
    Windows expert so maybe these links won't help as much as I most abjectly and
    sincerely hope they will.

    <http://izt.name/soft/types/>

    Based on the screenshots at
    <http://www.winvistaclub.com/t19.html>
    it looks like Types gives you access to the command line for the association.

    I apologize but my abjectness and desire to help only extended to five minutes
    of Internet search on "windows 7 set file associations", but I noted that many
    of the links from that search seemed quite promising.

    --
    Lew
    Honi soit qui mal y pense.
    http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg
     
    Lew, Jul 1, 2012
    #5
  6. Arne Vajhøj

    Lew Guest

    Qu0ll wrote:
    > No worries and thanks for the links. I am not at all "bent out of shape" and
    > thankfully I have solved the problem by hacking the registry after reading
    > Stefan's post. As markspace also indicated, I am surprised that a simple
    > reinstall of the JRE did not resolve the issue.


    I am actually very glad you aren't upset.

    I seriously do think that utility to which I linked shows promise, modulo my
    ignorance of Windows 7.

    --
    Lew
    Honi soit qui mal y pense.
    http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg
     
    Lew, Jul 1, 2012
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. cyberco
    Replies:
    4
    Views:
    3,777
    Roedy Green
    Feb 14, 2006
  2. Stefan Ram
    Replies:
    0
    Views:
    318
    Stefan Ram
    Jul 1, 2012
  3. markspace
    Replies:
    0
    Views:
    279
    markspace
    Jul 1, 2012
  4. Roedy Green
    Replies:
    0
    Views:
    293
    Roedy Green
    Jul 1, 2012
  5. Replies:
    2
    Views:
    324
    Roedy Green
    Jul 1, 2012
Loading...

Share This Page