Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #34349 > unrolled thread

clickable jars

Started byRoedy Green <see_website@mindprod.com.invalid>
First post2016-05-20 11:28 -0700
Last post2016-07-06 14:13 -0700
Articles 7 — 5 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  clickable jars Roedy Green <see_website@mindprod.com.invalid> - 2016-05-20 11:28 -0700
    Re: clickable jars Martin Gregorie <martin@address-in-sig.invalid> - 2016-05-20 19:31 +0000
      Re: clickable jars Lew <lewbloch@gmail.com> - 2016-05-20 12:49 -0700
        Re: clickable jars Roedy Green <see_website@mindprod.com.invalid> - 2016-05-20 13:00 -0700
      Re: clickable jars Roedy Green <see_website@mindprod.com.invalid> - 2016-05-20 12:55 -0700
    Re: clickable jars Nigel Wade <nmw@ion.le.ac.uk> - 2016-05-23 09:25 +0100
    Re: clickable jars Roedy Green <inquiry@mindprod.com> - 2016-07-06 14:13 -0700

#34349 — clickable jars

FromRoedy Green <see_website@mindprod.com.invalid>
Date2016-05-20 11:28 -0700
Subjectclickable jars
Message-ID<uklujb91cpbrk168agqqm8mh88ag8icaff@4ax.com>
Has anyone got jar to be clickable in windows 10?

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

Just plain reinstalling the JRE does not work for me either.  All the
registry entries look fine, but they don't launch.
-- 
Roedy Green Canadian Mind Products http://mindprod.com
Incorrect documentation is often worse than no documentation.
~ Bertrand Meyer (born:1950 age 65)

[toc] | [next] | [standalone]


#34350

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2016-05-20 19:31 +0000
Message-ID<nhnomn$8nh$1@dont-email.me>
In reply to#34349
On Fri, 20 May 2016 11:28:42 -0700, Roedy Green wrote:

> Has anyone got jar to be clickable in windows 10?
>
An obvious question, which I| haven't seen you answer yet is: does the 
jarfile have a manifest file and, if so, does its MainClass name the 
class to be started?

I'm not even slightly a W10 user, but it is required on a Linux system 
for the command "java -jar /path/to/jarfile.jar" to work.  
exit


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [next] | [standalone]


#34351

FromLew <lewbloch@gmail.com>
Date2016-05-20 12:49 -0700
Message-ID<48151d88-e677-40e1-a09f-da65d09a44cf@googlegroups.com>
In reply to#34350
On Friday, May 20, 2016 at 12:35:24 PM UTC-7, Martin Gregorie wrote:
> On Fri, 20 May 2016 11:28:42 -0700, Roedy Green wrote:
> 
> > Has anyone got jar to be clickable in windows 10?
> >
> An obvious question, which I| haven't seen you answer yet is: does the 
> jarfile have a manifest file and, if so, does its MainClass name the 
> class to be started?
> 
> I'm not even slightly a W10 user, but it is required on a Linux system 
> for the command "java -jar /path/to/jarfile.jar" to work.  
> exit

http://docs.oracle.com/javase/tutorial/deployment/jar/appman.html
http://docs.oracle.com/javase/8/docs/technotes/guides/jar/jarGuide.html
http://docs.oracle.com/javase/8/docs/technotes/tools/windows/jar.html

-- 
Lew

[toc] | [prev] | [next] | [standalone]


#34353

FromRoedy Green <see_website@mindprod.com.invalid>
Date2016-05-20 13:00 -0700
Message-ID<d0rujbt6a0t61tr5ubo2scpm8cdskgqu30@4ax.com>
In reply to#34351
On Fri, 20 May 2016 12:49:55 -0700 (PDT), Lew <lewbloch@gmail.com>
wrote, quoted or indirectly quoted someone who said :

>http://docs.oracle.com/javase/8/docs/technotes/guides/jar/jarGuide.html

That says the installer sets up an association.  Indeed it does. The
registry is just what you would expect.  The only catch is
xxx.jar does not work.

Perhaps there are more that two registry entries that have to be set
up for this to work, and the installer presumes the others are already
ok.

I have done a lot of digging on the Internet.  Lots on pre Windows 10,
but nothing other than reinstall the JRE on Windows 10.  This works
for some people, but not others (like me).  If I only knew what a
working registry looks like, I could write something to repair it.
-- 
Roedy Green Canadian Mind Products http://mindprod.com
Incorrect documentation is often worse than no documentation.
~ Bertrand Meyer (born:1950 age 65)

[toc] | [prev] | [next] | [standalone]


#34352

FromRoedy Green <see_website@mindprod.com.invalid>
Date2016-05-20 12:55 -0700
Message-ID<1qqujbpe646qjltd1vggi8c712iv52prm7@4ax.com>
In reply to#34350
On Fri, 20 May 2016 19:31:35 -0000 (UTC), Martin Gregorie
<martin@address-in-sig.invalid> wrote, quoted or indirectly quoted
someone who said :

>An obvious question, which I| haven't seen you answer yet is: does the 
>jarfile have a manifest file and, if so, does its MainClass name the 
>class to be started?

These are all kosher jars than were clickable fine in Windows 7.

They also start fine with

java -jar xxx.jar

By experiments I now Windows is invoking java.exe correctly, but not
passing it the correct parameters.
-- 
Roedy Green Canadian Mind Products http://mindprod.com
Incorrect documentation is often worse than no documentation.
~ Bertrand Meyer (born:1950 age 65)

[toc] | [prev] | [next] | [standalone]


#34378

FromNigel Wade <nmw@ion.le.ac.uk>
Date2016-05-23 09:25 +0100
Message-ID<dqft2tFqc9uU1@mid.individual.net>
In reply to#34349
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.

[toc] | [prev] | [next] | [standalone]


#34766

FromRoedy Green <inquiry@mindprod.com>
Date2016-07-06 14:13 -0700
Message-ID<j2tqnbt0qk813m540ejeebjk6hf9hcrq5r@4ax.com>
In reply to#34349
On Fri, 20 May 2016 11:28:42 -0700, Roedy Green
<see_website@mindprod.com.invalid> wrote:

>Has anyone got jars to be clickable in windows 10?

I have got it to work. For the recipe see
http://mindprod.com/jgloss/jar.html#ASSOCIATION

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web