您是否有任何人遇到过NetBeans 8.0.2 / Java的以下问题: 我在项目中有多个包,并且我已经在项目属性中设置了要执行的主类。编译项目工作得很好,但是当我构建和清理,然后从命令行执行应用程序时,它会说:
> Exception in thread "main" java.lang.NoClassDefFoundError: #projectname omitted#
任何帮助和建议都将不胜感激!
由于
修改
这是来自NetBeans的构建和干净日志:
(“...”是我为某些目的而省略的文件夹名称)
ant -f "C:\\Program Files\\...\\WhoWhatIMS" -Dnb.internal.action.name=rebuild clean jar
init:
deps-clean:
Created dir: C:\Program Files\...\WhoWhatIMS\build
Updating property file: C:\Program Files\...\WhoWhatIMS\build\built-clean.properties
Deleting directory C:\Program Files\...\WhoWhatIMS\build
clean:
init:
deps-jar:
Created dir: C:\Program Files\...\WhoWhatIMS\build
Updating property file: C:\Program Files\...\WhoWhatIMS\build\built-jar.properties
Created dir: C:\Program Files\...\WhoWhatIMS\build\classes
Created dir: C:\Program Files\...\WhoWhatIMS\build\empty
Created dir: C:\Program Files\...\WhoWhatIMS\build\generated-sources\ap-source-output
Compiling 8 source files to C:\Program Files\...\WhoWhatIMS\build\classes
Copying 10 files to C:\Program Files\...\WhoWhatIMS\build\classes
Copied 2 empty directories to 1 empty directory under C:\Program Files\...\WhoWhatIMS\build\classes
compile:
Created dir: C:\Program Files\...\WhoWhatIMS\dist
Copying 1 file to C:\Program Files\...\WhoWhatIMS\build
Copy libraries to C:\Program Files\...\WhoWhatIMS\dist\lib.
Building jar: C:\Program Files\...\WhoWhatIMS\dist\WhoWhatIMS.jar
To run this application from the command line without Ant, try:
java -jar "C:\Program Files\...\WhoWhatIMS\dist\WhoWhatIMS.jar"