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 230644 - Not possible to any features compiled with Java 1.7 in components designed with GUI builder
Summary: Not possible to any features compiled with Java 1.7 in components designed wi...
Status: RESOLVED DUPLICATE of bug 154197
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-03 08:28 UTC by jmsoft
Modified: 2016-09-01 09:03 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 jmsoft 2013-06-03 08:28:28 UTC
L.S.,
Steps to reproduce:
1.	Create project A that compiles with Java 1.7 and add some class D.
2.	Design a component C1 with the GUI builder.
3.	In the source generated by the GUI builder for C1 use class D from project A. This compiles, and also C1 is still shown correctly in the GUI builder.
4.	Design component C2 with the GUI builder.
5.	Try to drop an instance of C1 on C2 using the GUI builder (i.e. either first add C1 to the palette or use ‘Choose bean’ in the palette).
6.	A popup appears which shows the following exception:
------------------------------------------------------------------
java.lang.UnsupportedClassVersionError: com/iksbv/saturn/zui/tiles/components/ICurrentStatusAK : Unsupported major.minor version 51.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:465)
	at org.netbeans.modules.form.project.ProjectClassLoader.findClass(ProjectClassLoader.java:172)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:465)
	at org.netbeans.modules.form.project.ProjectClassLoader.findClass(ProjectClassLoader.java:172)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at org.netbeans.modules.form.project.FormClassLoader.findClass(FormClassLoader.java:83)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:247)
	at org.netbeans.modules.form.project.ClassPathUtils.loadClass(ClassPathUtils.java:114)
	at org.netbeans.modules.form.MetaComponentCreator$5.run(MetaComponentCreator.java:1435)
	at org.netbeans.modules.form.FormLAF$2.run(FormLAF.java:293)
	at org.openide.util.Mutex.doEventAccess(Mutex.java:1363)
	at org.openide.util.Mutex.readAccess(Mutex.java:322)
	at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:276)
	at org.netbeans.modules.form.MetaComponentCreator.prepareClass(MetaComponentCreator.java:1431)
	at org.netbeans.modules.form.MetaComponentCreator.precreateVisualComponent(MetaComponentCreator.java:262)
	at org.netbeans.modules.form.MetaComponentCreator.precreateVisualComponent(MetaComponentCreator.java:306)
	at org.netbeans.modules.form.HandleLayer$NewComponentDrag.init(HandleLayer.java:3283)
	at org.netbeans.modules.form.HandleLayer$NewComponentDrag.<init>(HandleLayer.java:3275)
	at org.netbeans.modules.form.HandleLayer$NewComponentDropListener.dragEnter(HandleLayer.java:3571)
	at java.awt.dnd.DropTarget.dragEnter(DropTarget.java:341)
	at sun.awt.dnd.SunDropTargetContextPeer.processEnterMessage(SunDropTargetContextPeer.java:312)
	at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEnterEvent(SunDropTargetContextPeer.java:779)
	at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEvent(SunDropTargetContextPeer.java:747)
	at sun.awt.dnd.SunDropTargetEvent.dispatch(SunDropTargetEvent.java:30)
	at java.awt.Component.dispatchEventImpl(Component.java:4508)
	at java.awt.Container.dispatchEventImpl(Container.java:2099)
	at java.awt.Component.dispatchEvent(Component.java:4481)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
	at java.awt.LightweightDispatcher.trackMouseEnterExit(Container.java:4366)
	at java.awt.LightweightDispatcher.processDropTargetEvent(Container.java:4304)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4163)
	at java.awt.Container.dispatchEventImpl(Container.java:2085)
	at java.awt.Window.dispatchEventImpl(Window.java:2478)
	at java.awt.Component.dispatchEvent(Component.java:4481)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
	at java.awt.EventQueue.access$000(EventQueue.java:84)
	at java.awt.EventQueue$1.run(EventQueue.java:602)
	at java.awt.EventQueue$1.run(EventQueue.java:600)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
	at java.awt.EventQueue$2.run(EventQueue.java:616)
	at java.awt.EventQueue$2.run(EventQueue.java:614)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
------------------------------------------------------------------

Kind regards,
John Meertens
Comment 1 Tomas Pavek 2013-06-03 15:08:16 UTC
If trying to instantiate a class compiled for Java 7 you also need to run the IDE on Java 7. I'd guess your IDE runs on Java 6. We miss a more comprehensive error message that would explain that.

*** This bug has been marked as a duplicate of bug 154197 ***
Comment 2 jmsoft 2013-06-04 06:58:38 UTC
L.S.,

I have seen in the thread that this bug was changed to enhancement. Does this mean that the error message shown to the user will be changed to be clearer, or will GUI builder be changed to solve the problem reported?

Kind regards,
John Meertens
Comment 3 Tomas Pavek 2013-06-04 08:58:24 UTC
There will be a clearer error message. There is no solution otherwise, Java VM can't load classes of higher version than it supports, so IDE running on Java 6 can't load classes that were compiled for Java 7.
Comment 4 jmsoft 2013-06-04 11:33:33 UTC
Thanks for your fast answer. I understand your answer (it was also to be seen in the exception). 

Sorry that I insist, but this is very important for me. I was just wondering: is it not possible to rebuild the GUI builder and everything that goes with it with Java 7?


Kind regards,
John Meertens
Comment 5 Tomas Pavek 2016-09-01 09:03:38 UTC
To avoid this problem just run your NetBeans on Java 8.