5 Replies - 789 Views - Last Post: 08 October 2012 - 07:37 PM Rate Topic: -----

#1 g37752  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 195
  • Joined: 24-July 12

double click on working?

Posted 08 October 2012 - 01:48 PM

I am not sure if this is the right place to post this, but..

I create a java executable .jar. It works in command prompt, but does not work by double click.

I read Windows file association, edit the registry, but still cannot get it to work.
depending on the version of jre, if its jre6, it says "main class not found". if i use jre7, no response.

I check in command prompt using "assoc .jar" and "ftype jarfile" and they confirm my registry entry:

HKEY_CURRENT_USER:software:classes:Applications:javaw.exe:shell:open:command
   "C:\\Program Files\Java\jre6\bin\javaw.exe" "%1"
HKEY_CLASSES_ROOT:jarfile:shell:open:command
   "C:\\Program Files\Java\jre6\bin\javaw.exe" -jar "%1" %*


I tried in command prompt
"C:\\Program Files\Java\jre6\bin\javaw.exe" -jar a.jar

works in both cases.

I can only think of "%*" thats not working??

anybody help?

This post has been edited by g37752: 08 October 2012 - 02:21 PM


Is This A Good Question/Topic? 0
  • +

Replies To: double click on working?

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9573
  • View blog
  • Posts: 36,255
  • Joined: 12-June 08

Re: double click on working?

Posted 08 October 2012 - 01:52 PM

I think you misunderstand what a JAR file is...

Quote

A JAR (Java ARchive) file is a file that contains the class, image, and sound files for a Java application or applet gathered into a single file and possibly compressed.
cite

.. and moving from software dev to java.
Was This Post Helpful? 0
  • +
  • -

#3 rfs02  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 26
  • View blog
  • Posts: 70
  • Joined: 30-September 12

Re: double click on working?

Posted 08 October 2012 - 02:10 PM

It should be:

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


Was This Post Helpful? 1
  • +
  • -

#4 g37752  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 195
  • Joined: 24-July 12

Re: double click on working?

Posted 08 October 2012 - 02:22 PM

View Postrfs02, on 08 October 2012 - 02:10 PM, said:

It should be:

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




sorry, that was a typo. I did include -jar in "jarfile" entry already.

View Postmodi123_1, on 08 October 2012 - 01:52 PM, said:

I think you misunderstand what a JAR file is...

Quote

A JAR (Java ARchive) file is a file that contains the class, image, and sound files for a Java application or applet gathered into a single file and possibly compressed.
cite

.. and moving from software dev to java.


the reason, i post it in software development is because i think this is more related to the OS now. not java anymore. it's a file association problem.

This post has been edited by g37752: 08 October 2012 - 02:26 PM

Was This Post Helpful? 0
  • +
  • -

#5 rfs02  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 26
  • View blog
  • Posts: 70
  • Joined: 30-September 12

Re: double click on working?

Posted 08 October 2012 - 02:41 PM

Try this link, hope it helps:

http://answers.micro...76-a27cb7e6cbff
Was This Post Helpful? 1
  • +
  • -

#6 g37752  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 195
  • Joined: 24-July 12

Re: double click on working?

Posted 08 October 2012 - 07:37 PM

View Postrfs02, on 08 October 2012 - 02:41 PM, said:

Try this link, hope it helps:

http://answers.micro...76-a27cb7e6cbff


jarfix.exe ends my 3 days of misery! cannot thank you enough! :bigsmile:
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1