开发者

.jar working in command line but NOT in windows explorer

开发者 https://www.devze.com 2023-01-21 07:06 出处:网络
I have an SWT application that I\'m trying to create a runnable .jar for; unfortunately, I cannot seem to run it fr开发者_开发问答om Windows Explorer, as I get an error from the Java Virtual Machine L

I have an SWT application that I'm trying to create a runnable .jar for; unfortunately, I cannot seem to run it fr开发者_开发问答om Windows Explorer, as I get an error from the Java Virtual Machine Launcher stating it:

"Could not find the main class gui.MainWindow. Program will exit."

However, it will run through command line

java -jar xxxxx.jar

I have spent a considerable amount of time looking through threads that have lead me to:

  1. edit the manifest file
  2. switch through the runtime versions of javaw.exe

all to no avail.

I am creating the executable .jar file in eclipse (including my referenced swt libraries), and have also tried the fat-jar plugin. Again, it will run inside of eclipse with no issues.

I cannot afford a work-around such as a .bat or turning it into a .jex

I have a nagging feeling it is down to me being on a 64-bit system, however, I have gone through both 64-bit and 32-bit versions of javaw.exe as previously stated.

Any suggestions would be more than welcome.


If your app. has a GUI, launch it using Java Web Start.


I have just re-installed the JDK and JRE for 64-bit systems and have used Default Programs Editor

to re-assign the .jar association to the 64-bit jre6 javaw.exe, which, seems to have solved my problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号