This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
In NetBeans 6.1, created new application selecting Java/Java Desktop Application/Basic Application. Without any further changes, I performed Build on the resulting code. I triggered Run from within NetBeans, and the application presented the Basic Application Example screen. I then opened a cmd window, and, after moving to the dist subdirectory containing the .jar file for this project, I entered "java -jar TestBasicDesktopApplication.jar", and got the following error: C:\Java\Projects\TestBasicDesktopApplication\dist>java -jar TestBasicDesktopApplication.jar Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: javax/swing/GroupLayout$Group at testbasicdesktopapplication.TestBasicDesktopApplication.startup(TestBasicDesktopApplication.java:19) at org.jdesktop.application.Application$1.run(Application.java:171) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) This defect prevents me from releasing my application based on the Basic Desktop Application template! I am running Java SE 6 Update 7 (build 1.6.0_07-b06). I can't tell if the problem is with NetBeans or the JVM, but there is clearly an inconsistency between them.
Reassigning to form.
> I am running Java SE 6 Update 7 (build 1.6.0_07-b06). Yes, it seems that you are running NetBeans on this JDK, but the JVM started from the command line probably is not JDK 6. The exception clearly shows that there is missing javax.swing.GroupLayout.Group in the Java used by your 'java' command (GroupLayout was added in JDK 6; it is not present in JDK 5). What is the output of 'java -version' command?
Response from the reporter: Thank you for your reply. The information I previously reported: Java SE 6 Update 7 (build 1.6.0_07-b06), was obtained from the About Java screen which appears when I right-click the Java icon in the system tray on my desktop. I did not find a java-version.exe on my hard-drive. Running java-version from http://www.java.com/en/download/installed.jsp, I get: You have the recommended Java installed (Version 6 Update 7). Please let me know what other information I can provide.
>> What is the output of 'java -version' command? > I did not find a java-version.exe on my hard-drive. Note the space in the mentioned command e.g. -version is not a part of the executable file, it is the first argument. It seems that a plain 'java' command didn't start JDK 6 on your machine. If this is the case then you shouldn't use java -jar TestBasicDesktopApplication.jar, but <PATH_TO_JDK_6>\bin\java -jar TestBasicDesktopApplication.jar
The reporter confirmed that he executed JDK 5 accidentally => closing the issue.