I don't know much 开发者_开发知识库about compiling files: when I tried compiling files on Windows Vista, the JAR file works fine, the application runs just fine. I copied all files to a Mac OS X, tried to run the JAR file, nothing happen, the application doesn't work, why?
EDIT: When I try to display a JFrame, I get the error only in Mac OS X:
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: javax/swing/GroupLayout$Group
GroupLayout is created by Netbeans by drag-and-drop components to the JFrame. Please help!
A common problem (if you have a Swing GUI), is that not all of Swing is available on OSX. I encountered this problem after creating a game in Java at university and tried to show it off to my Dad on his Mac...
Have you tried running the JAR from the command line to see what, if any exceptions are being thrown?
If your program contains absolutely path, like
D:\Foo\bar...
it will not work.
or if it has some platform dependences code.
Try to remove this code.
精彩评论