简体   繁体   English

Java .jar文件与命令行和文件资源管理器的运行方式不同

[英]Java .jar file Run Differently from Command Line and File Explorer

I recently wrote an application that is packaged as a .jar file. 我最近写了一个打包为.jar文件的应用程序。 When I run the application from the command line via "java -jar MyProject.jar" everything looks perfect, just as it does when run from within eclipse. 当我通过“ java -jar MyProject.jar”从命令行运行应用程序时,一切看起来都很完美,就像在eclipse中运行时一样。 However when I go to the file location in the file explorer and double clock the file, it doesn't quite work. 但是,当我转到文件资源管理器中的文件位置并对文件加倍计时时,它不能正常工作。 All of the functionality is there, but the GUI is not quite right. 所有功能都在那里,但是GUI不太正确。 All text is much larger, despite the application not changing size, when run like this, to the point where much of it is cut off. 尽管应用程序未更改大小,但所有文本都大得多,当这样运行时,其大部分内容都被截断了。

Anyone know whats going on? 有人知道发生了什么吗? Thanks! 谢谢!

造成此问题的原因是,从命令行运行时,程序是使用JRE 1.8.0_172运行的,但是从文件资源管理器运行时,程序使用的是JDK 10.0.1。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM