简体   繁体   English

导出Java的最佳方法

[英]Best Way to Export Java

So what I want to export is a normal I/O or similar program (no GUIs and such) and what I am doing it for is in the Java BPA Competition. 因此,我要导出的是普通的I / O或类似程序(没有GUI等),而我要做的是在Java BPA竞赛中。 Recently, I have handed in my project as an runnable jar file (and also provided a copy of the source code), however, I was marked down for the runnable jar file and received no points in the Program Execution part with the only note back being "check executable .jar." 最近,我将项目作为可运行的jar文件提交(并提供了源代码的副本),但是,我被标记为可运行的jar文件,并且在程序执行部分中没有得到任何分数,仅提供了回注被“检查可执行文件.jar”。 The runnable jar file was fine (I think) since it seemed to work fine on my Windows computer when I ran it from the cmd. 可运行的jar文件很好(我认为),因为当我从cmd运行它时,它在Windows计算机上似乎可以正常工作。 (Should also add I used the IDE Eclipse) (还应该添加我使用的是IDE Eclipse)

Any suggestions for a better export method for Java projects or why the runnable jar may have not worked are very appreciated! 非常感谢为Java项目提供更好的导出方法的任何建议,或者为什么可运行jar可能无法正常工作!

I would check documentation for the competition or ask those involved, but more is always better in my experience. 我会检查比赛的文档或询问相关人员,但根据我的经验,总能找到更好的方法。

A folder with separate packages for the executable .jar, the compiled classes and source code (if applicable for being turned in) would probably be better - or maybe they were looking for an .exe that would act as a wrapper and launch the Java program - like what Minecraft has. 一个文件夹,其中包含用于可执行文件.jar,已编译的类和源代码(如果适用于上交)的单独软件包,则可能会更好-或者它们正在寻找充当包装器并启动Java程序的.exe。 -像《我的世界》一样。

Without more information its hard to help you, on looking at what you were marked, IE "Check Executable .jar" implies that it did not actually run easily and first time for your instructor. 没有更多信息,很难帮助您查看被标记的内容,即“ Check Executable .jar” IE并不真正容易地运行,对于您的指导者来说是第一次。 Perhaps it ran on your machine and not theirs because of some dependency that they had to manually install, something thats very easy with Eclipse as it will often link to sources in Eclipse that are not exported, its always best to test your compiled jar on a "clean" machine or VM without eclipse just a stock windows machine with a JRE. 也许它是在您的计算机上运行的,而不是在他们的计算机上运行的,因为他们必须手动安装某些依赖项,这在Eclipse中非常容易,因为它通常会链接到未导出的Eclipse中的源代码,因此始终最好在Windows上测试已编译的jar不会蚀的“干净”机器或VM只是带有JRE的普通Windows机器。 Other possible options are they were expecting a complete build containing the target JRE compiled into the build or an executable thus requiring no specific JRE on the target system? 其他可能的选择是他们期望包含目标JRE的完整构建或编译成可执行文件的完整构建,从而在目标系统上不需要特定的JRE吗?

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

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