Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Nigel Wade Newsgroups: comp.lang.java.programmer Subject: Re: clickable jars Date: Mon, 23 May 2016 09:25:01 +0100 Lines: 40 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net i/kJOAH45uly6t/6wYtEJwDf2T6SxL5QhXUMEPnAHixUiJT5Os Cancel-Lock: sha1:riAcQjjliZxHOB0K1Zztytn8BGs= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 In-Reply-To: Xref: csiph.com comp.lang.java.programmer:34378 On 20/05/16 19:28, Roedy Green wrote: > Has anyone got jar to be clickable in windows 10? > For me they Just Work. > i.e. type xxx.jar on the command line and have it execute with > javaw.exe or java.exe > > If you have W10-32 and W10-64, you can reinstall the JRE or JDK which > will set up a link from jars to that jvm. Then use regedit.exe to find > the jar link to javaw.exe in the registry, and modify it to java.exe. > The link looks like this: Computer : HKEY_CLASSES_ROOT : jarfile : > shell : open : command : "C:\Program > Files\java\jre1.8.0_92\bin\javaw.exe" -jar "%1" %*. Or you can run > under administrator filetype jarfile= "C:\Program > Files\java\jre1.8.0_92\bin\javaw.exe" -jar "%1" %* at a command > prompt. Do not put the command in a bat file or the " and % quoting > will confuse it. Then run under administrator assoc .jar=jarfile > Though in theory this should work, I cannot get it to. I always get an > error message like this Error: Could not find or load main class > E:\mindprod\applet\xxx.jar I have not edited the registry at all. Jars work fine. If I edit the registry to alter javaw to java then the jar also runs, but in a command shell with the standard output/error going to the command shell. After changing it back to javaw it continues to work as expected. > > Just plain reinstalling the JRE does not work for me either. All the > registry entries look fine, but they don't launch. > Is your system a fresh install of W10, or an upgrade? If it's an upgrade, maybe there is something you have done in the history of the original Windows that has adversely affected the operation of javaw.exe/java.exe after upgrading to W10. The machine I tested it on is a Surface 3 Pro, which was originally supplied with W8, later upgraded to W8.1 and then to W10. If your upgrade path is different that may explain the different end results.