Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //I'm trying to use new classes in java 1.6 and I keep getting an unrecognized
- //class error, or output. The program terminates, but never renders. I've tried
- //exporting it as .java and Mac OS X application and it comes up damaged or incomplete.
- //Here is the Unix response with javac
- //Below is the Eclipse responses
- //I'm also getting a annotation must be explicitly implied or something error with
- //the new classes.
- USER:gamePackage1 administrator$ javac gameClass1.java
- gameClass1.java:8: cannot find symbol
- symbol : class Display
- location: class gamePackage1.gameClass1
- public static Display f = new Display();
- ^
- gameClass1.java:8: cannot find symbol
- symbol : class Display
- location: class gamePackage1.gameClass1
- public static Display f = new Display();
- //
- //
- //THIS IS ECLIPSE DEBUGGING OUTPUT 1 OF 2
- //
- //
- Display at localhost:65190
- Thread [main] (Suspended (exception ClassNotFoundException))
- owns: Launcher$AppClassLoader (id=22)
- URLClassLoader$1.run() line: 202
- AccessController.doPrivileged(PrivilegedExceptionAction<T>, AccessControlContext) line: not available [native method]
- Launcher$AppClassLoader(URLClassLoader).findClass(String) line: 190
- Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line: 306
- Launcher$AppClassLoader.loadClass(String, boolean) line: 301
- Launcher$AppClassLoader(ClassLoader).loadClass(String) line: 247
- Daemon Thread [Thread-1] (Running)
- /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java (Dec 18, 2014, 2:01:23 AM)
- //
- //
- //THIS IS ECLIPSE OUTPUT 2 OF 2
- //
- //
- Exception in thread "main" java.lang.NoClassDefFoundError: Display
- Caused by: java.lang.ClassNotFoundException: Display
- at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
- at java.security.AccessController.doPrivileged(Native Method)
- at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
- at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
- at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
- at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
- //
- //
- //HERE IS MY CODE 1 OF 2
- //
- //
- package gamePackage1;
- import javax.swing.JFrame;
- public class gameClass1 {
- public static Display f = new Display();
- public static int w = 600;
- public static int h = 400;
- static void main(String args[]) {
- f.setSize(w, h);
- f.setResizable(true);
- f.setVisible(true);
- f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- f.setTitle("JavaGame");
- f.setLocationRelativeTo(null);
- System.out.println("Window Coherent...");
- }
- }
- //
- //
- //HERE IS MY CODE 2 OF 2
- //
- //
- package gamePackage1;
- import javax.swing.JFrame;
- public class Display extends JFrame{
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement