当我运行我的可执行文件(.exe)时,它显示Java帮助菜单

时间:2014-01-17 19:30:39

标签: java class deployment executable executable-jar

我是Java程序部署的新手。我正在尝试将我的Java类(.class)文件转换为可执行(.exe)文件。我的JRE和JDK版本是1.7.0_25。

我有一个源文件,并使用以下命令将其转换为可执行jar(.jar):

java cfm NameOfJar.jar manifest.txt SourceFile.class

当我运行命令时:

java -jar NameOfJar.jar

程序运行正常。然后我为Windows安装了“Launch4J”和“JSmooth”,并按照所有指示制作了可执行文件。当我点击Launch4J的可执行文件时,没有任何反应;当我点击JSmooth制作的可执行文件时,命令提示符窗口会快速打开和关闭。当我通过命令提示符运行程序时,就会出现这种情况:

C:\Users\Jon\Documents>NameOfExe.exe
Usage: java [-options] class [args...]
        (to execute a class)
    or java [-options] -jar jarfile [args...]
        (to execute a jar file)
where options include:
    -d32          use a 32-bit data model if available

...more options here...

    -splash:<imagepath>
        show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.

在这个过程中我做错了什么?我该如何解决?

感谢。

0 个答案:

没有答案