Standalone Netbeans GUI App
843785Dec 20 2008 — edited Dec 20 2008I have searched diligently for the answer to my problem with creating a standalone GUI from Netbeans and I still cant find the solution that works. I am sorry if this question has been worn out but I still cant get the help I need and this posting is my last resort.
I made a simple GUI in Netbeans 6.5 and run the build and/or build-clean. I get the msg from the output :
init:
deps-jar:
compile:
Copy libraries to /home/ubuser1/NetBeansProjects/TextMangler/dist/lib.
To run this application from the command line without Ant, try:
java -jar "/home/ubuser1/NetBeansProjects/TextMangler/dist/TextMangler.jar"
jar:
BUILD SUCCESSFUL (total time: 0 seconds)
So, I do what it says by typing from CLI: java -jar /home/ubuser1/NetBeansProjects/TextMangler/dist/TextMangler.jar
and the CLI output is this:
Exception in thread "main" java.lang.UnsupportedClassVersionError: textmangler/TextManglerApp (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:272)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
I found some postings about a manifest.mf file, so I opened it and it only has these lines:
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build
So, I wonder if the IDE is not placing the "main" class in the Class-Path or something.
also, my Netbeans JDK version is not the same as the JDK I have installed.
the output for java -version:
java version "1.4.1_07"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_07-b02)
Java HotSpot(TM) Client VM (build 1.4.1_07-b02, mixed mode)
so I removed that version of java from my $PATH and used the one that was installed sometime before.
java -version:
java version "1.5.0_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05)
Java HotSpot(TM) Client VM (build 1.5.0_13-b05, mixed mode, sharing)
When I try running it from this JRE with the same java -jar /home/......jar( as before)
I get the following:
/usr/share/themes/Glossy/gtk-2.0/gtkrc:35: error: lexical error or unexpected token, expected valid token
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: javax/swing/GroupLayout$Group
at textmangler.TextManglerApp.startup(TextManglerApp.java:19)
at org.jdesktop.application.Application$1.run(Application.java:171)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
So, this is where I am stuck. If anyone can help I would greatly appreciate it.