简体   繁体   English

从Eclipse导出的可运行JAR文件似乎无法执行

[英]Exported runnable JAR file from Eclipse doesn't seem to execute

(Disclaimer: I am not a Java programmer, and really have very little idea what I'm doing in Eclipse) (免责声明:我不是Java程序员,我真的很想不到我在Eclipse中做了什么)

I hacked out an application in Eclipse a while back which I finished off and exported as a JAR which runs nicely. 我在Eclipse中删除了一个应用程序,最后我完成并导出为JAR,运行得很好。 I didn't take any notes or make any comments. 我没有做任何笔记或发表任何评论。

The time comes to make some changes to the project but I have to reload it all again because my PC has since been wiped so some settings etc have probably changed. 是时候对项目进行一些更改了,但是我必须重新加载它,因为我的PC已经被擦除所以一些设置等可能已经改变了。

Anyway it all works and runs nicely from Eclipse. 无论如何,它都可以在Eclipse中运行并运行良好。 But when I export as a runnable JAR, and double click to run the application, it doesn't seem to execute. 但是当我导出为可运行的JAR,并双击运行应用程序时,它似乎没有执行。

I can see that there is an instance of javaw running, but no window appears. 我可以看到有一个javaw运行的实例,但没有窗口出现。 No errors. 没有错误。 Nada. 纳达。

As I said, it works beautifully in Eclipse. 正如我所说,它在Eclipse中运行得非常好。 Any ideas? 有任何想法吗?

I have little idea of how I can detect what is going on - as I said, I am NOT a java programmer :-) 我不知道我怎么能检测到发生了什么 - 正如我所说,我不是一个java程序员:-)

Ok then, so you can mark the question closed: 好的,所以你可以标记问题:

If your Java installation is registered for the .jar extension it will try to run the Jar (i guess that's what's happening). 如果您的Java安装注册了.jar扩展名,它将尝试运行Jar(我猜这就是正在发生的事情)。 But it will do so quietly. 但它会悄然这样做。

In order to see what's happening (errors and such) you should try to run it from the command line with java -jar myfile.jar . 为了查看发生了什么(错误等),您应该尝试使用java -jar myfile.jar从命令行运行它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么从Eclipse导出的可运行JAR不起作用? - Why doesn't a runnable JAR exported from Eclipse work? 在运行时编译Java文件可在Eclipse上运行,但不能从导出的可运行jar文件中运行 - Compiling java file at runtime works on eclipse but doesn't work from an exported runnable jar file 项目在Eclipse中正常运行,但导出到可运行的jar时无法正常运行 - Project runs normal in Eclipse but doesn't when exported to a runnable jar 不会打开从 eclipse Mac OS 导出的可运行 jar - Won't open runnable jar exported from eclipse Mac OS 带导出的可运行jar文件的Java Eclipse错误 - Java eclipse error with exported runnable jar file 导出的可运行 jar 不包含来自 eclipse 2018-12 和 java 11 的依赖 jar。我们如何解决这个问题? - exported runnable jar doesn't contain dependency jars from eclipse 2018-12 with java 11. How do we solve this? 从Eclipse导出的JAR文件与可运行的JAR文件中的行为不同 - Different behavior in JAR file vs Runnable JAR file exported from Eclipse 用eclipse导出的可运行jar不起作用,在eclipse中它仍然有效 - Runnable jar exported with eclipse isn't working, in eclipse it still works 在Eclipse中导出后,可运行的JAR文件未运行 - Runnable JAR file doesn't run after export in Eclipse 导出的日食可运行.jar将无法运行 - Exported eclipse runnable .jar will not run
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM