netbeans jar-won';不能从命令行工作
我使用NetBeans 8.2创建了一个非常简单的Hello World程序。 但是,当我试图在Linux中使用netbeans jar-won';不能从命令行工作,netbeans,jar,Netbeans,Jar,我使用NetBeans 8.2创建了一个非常简单的Hello World程序。 但是,当我试图在Linux中使用 java -jar dist/HelloWorld.jar 我得到以下错误: Error: Could not find or load main class helloworld.HelloWorld 我试着按照其他地方的指示,把这个项目作为主要项目 在Web上,文件META-INF/MANIFEST.FM看起来是正确的: Manifest-Version: 1.0 Imple
java -jar dist/HelloWorld.jar
我得到以下错误:
Error: Could not find or load main class helloworld.HelloWorld
我试着按照其他地方的指示,把这个项目作为主要项目
在Web上,文件META-INF/MANIFEST.FM看起来是正确的:
Manifest-Version: 1.0
Implementation-Title: HelloWorld
X-COMMENT: Main-Class will be added automatically by build
Implementation-Version: 1.0
Permissions: sandbox
Codebase: *
JavaFX-Version: 8.0
Class-Path:
Created-By: JavaFX Packager
Implementation-Vendor: bob
Main-Class: helloworld.HelloWorld
不过,我还是犯了同样的错误。我怎样才能让它工作?????我一直在
为此战斗了几个小时
如果你需要更多的信息,请告诉我
谢谢。你的HelloWorld课程有课程吗
public static void main(String[] args) {
//Some code
}
问这个问题已经有一段时间了,我在面对同样的问题时发现了这条线索,并尝试了在web上找到的一切。。。好消息是我终于解决了 您需要下载文件“jfxrt.jar”并将其放入“/usr/lib/jvm/[java]/jre/lib/ext”(假设您使用的是Ubuntu)。然后,您需要使用以下方法安装openjfx:
sudo apt-get install openjfx
下次在NetBeans中清理和构建项目时,您可能会在'dist'目录中找到一个runnable.jar文件。是的,它有一个main方法。事实上,HelloWorld.java是唯一的源文件。