3

I am trying to run a very simple program by double clicking my Jar file with javaw.

It runs fine from Netbeans AND from the command line.

My registry path to javaw:

"C:\Program Files\Java\jre1.8.0_102\bin\javaw.exe" -jar "%1" %*

What is going wrong here? How can I make this work when I double click the Jar?

nhouser9
  • 6,730
  • 3
  • 21
  • 42
pabitele
  • 31
  • 1
  • I've never run a jar by double clicking. I always run in from the command prompt. – Carcigenicate Oct 05 '16 at 23:49
  • You have Added java to the system path? – Kate Oct 05 '16 at 23:54
  • See [How to run .jar file by double click on Windows 7 (64)](http://stackoverflow.com/questions/8511063/how-to-run-jar-file-by-double-click-on-windows-7-64) –  Oct 06 '16 at 00:15

1 Answers1

0

Make sure your JAR file is an executable JAR; I'm not entirely sure how to export an executable JAR from NetBeans (I use Eclipse), but this article seems to explain it pretty well.

Make sure javaw.exe is the default program for running JARs. This question addresses that.

There's also a Java Tutorial on making and using JARs, and several other StackOverflow questions about it.