0

Have any of you encountered the following issue with NetBeans 8.0.2/ Java: I have multiple packages in the projects, and I have set the Main Class for execution in the project properties. Compiling the project works perfectly, but when I Build and Clean, and then execute the app from command line, it says the following:

> Exception in thread "main" java.lang.NoClassDefFoundError: #projectname omitted#

Any help and suggestions will be appreciated!

Thanks

Edit:

This is the build and clean log from NetBeans:

("..." is a folder name which I have omitted for certain purposes)

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"

Johan Brink
  • 333
  • 5
  • 20
  • I think that some classes is not present in your project: are you sure that are presents? Can I post your log? – Musich87 Dec 04 '14 at 10:20
  • I'm sure everything is present. How do I post the log? Which log are you referring to? – Johan Brink Dec 04 '14 at 10:27
  • I see you edit, but I want to see your error totally.. Do you try to make before the Clean operation and the Build operation separately? – Musich87 Dec 04 '14 at 10:33
  • That's the only error I get from cmd. When opening the independent JAR file, it just doesn't start at all. I've just tried to Clean and Build separately, which results in the same error. – Johan Brink Dec 04 '14 at 10:41
  • You watch the answers in this link: http://stackoverflow.com/questions/17973970/how-to-solve-java-lang-noclassdeffounderror – Musich87 Dec 04 '14 at 10:45
  • @Musich87 Tried those suggestions in thread. Also checked the classpath which is correct, and the physical class file is there. – Johan Brink Dec 04 '14 at 11:02

0 Answers0