Runnable jar file generated by Eclipse wont execute?

天大地大妈咪最大 提交于 2019-11-29 07:42:25

Jars are never 'executable' in this sense. What this jar is good for is:

java -jar YOURJAR.jar

update the backtrace you supplied is bizarre. It appears that Windows decided to go ahead and launch your jar with some version of Java, but pass it a pathname in the place of a class name. I don't know what the story is with that.

Uninstalling all older java versions on my machine fixed the issue for me.

At my end I was able to run the .jar file with the command line, but not with the default double-click option. Afterwards the latter was working again

In my case, by mistake I had not declared the class containing public static void main() as a public class. After declaring the class as public was able to resolve this issue with the next export as runnable jar via eclipse...

Hope this helps...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!