-1

I have a jar file App.jar in C:\program files\My app\Data\ along with the JRE with a native launcher in C:\program files\My app\. The launcher is programmed to accept any command line args and pass it on to the jar file by calling it via the javaw -jar. I created an MSI package to install this whole thing and associated a filetype to the launcher. When double clicking an associated file, JVM says that "Unable to access jarfile at 'Data\App.jar'". However if I manually run the launcher with the same argument it works! Help!

Gynteniuxas
  • 7,035
  • 18
  • 38
  • 54
Rahul De
  • 393
  • 3
  • 14
  • After re-reading your question I can see you had a problem with the relative path 'Data\App.jar', you have to instruct the launcher to use an absolute path, or to make 'My app' the current directory before executing 'javaw -jar' command, you can do so in windows. with 'CD C:\..\My app' before the next command from a command line. Did you fixed this? – Jaime Hablutzel Jun 06 '12 at 23:06
  • Yeah got it.... rewrote the launcher in Qt and set the PWD to the folder and the it executed flawlessly... Thanks... – Rahul De Jul 02 '12 at 14:07

1 Answers1

0

I don't understand your question very well, but I think it is realted to the way you have created you MSI package, but anyway, you can take a look to:

http://jsmooth.sourceforge.net/

For allowing your .jar to be launched from an .exe, this apps creates a wrapper.

Jaime Hablutzel
  • 6,117
  • 5
  • 40
  • 57
  • The thing is, I have my own VM bundled inside the My App\Data Folder. The launcher is meant to call the javaw.exe inside the bin folder by passing the jar file as an argument. It also passes the path of the associated file if any to the jar file. For example, my command programmed in the launcher is "Data\bin\javaw.exe -jar Data\App.jar C:\test.ext". Where App.jar is my jar file and test.ext is my associated file. When i double click the test.ext file, javaw.exe gives the error message. But when i manually run the launcher with the same argument it works. eg. launcher.exe C:\Test.ext. – Rahul De Jul 06 '11 at 03:01
  • Were you ever able to figure this out? I found examples using Target but I keep getting an error that I cannot use Target when Shortcut is embedded inside a File tag. – Knoxie Jun 06 '12 at 19:12
  • maybe my first comment on the main question could help you – Jaime Hablutzel Jul 03 '12 at 20:53