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.

Bug 145724 - BasicDesktopApp runs under NetBeans, not directly with JVM
Summary: BasicDesktopApp runs under NetBeans, not directly with JVM
Status: RESOLVED INVALID
Alias: None
Product: guibuilder
Classification: Unclassified
Component: App Framework (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P1 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-31 18:28 UTC by jerryschreiber
Modified: 2008-09-03 16:05 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jerryschreiber 2008-08-31 18:28:05 UTC
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.
Comment 1 Peter Pis 2008-08-31 21:43:06 UTC
Reassigning to form.
Comment 2 Jan Stola 2008-09-01 09:35:37 UTC
> 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?
Comment 3 Jan Stola 2008-09-02 09:48:23 UTC
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.
Comment 4 Jan Stola 2008-09-02 09:54:51 UTC
>> 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
Comment 5 Jan Stola 2008-09-03 16:05:06 UTC
The reporter confirmed that he executed JDK 5 accidentally => closing the issue.