我已经实现了“Java编译”和“编译并运行”(第二个为Java编译并运行),如本答案中所述:Java compile and run using notepad++ and nppexec。无法找到或加载主类Java错误记事本++
注意:我使用的是1.8.0_20而不是1.7.0,如答案中所述。
然而,当我尝试运行的HelloWorld(如在这里找到:http://docs.oracle.com/javase/8/javafx/get-started-tutorial/hello_world.htm),以测试编译器,我得到如下回应,包括“无法找到或加载主类”错误:
NPP_EXEC: "Java Compile and Run"
CD: C:\Users\Bova\Documents
Current directory: C:\Users\Bova\Documents
"C:\Program Files (x86)\Java\jdk1.8.0_20\bin\java" -classpath "C:\Users\Bova\Documents" "HelloWorld"
Process started >>>
Error: Could not find or load main class HelloWorld
<<< Process finished. (Exit code 1)
================ READY ================
我需要更改哪些内容才能避免此错误?
如果您使用1.7.0,则必须手动将JavaFX添加到类路径中。 – 2014-10-05 21:31:57