Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 KB | None | 0 0
  1. //I'm trying to use new classes in java 1.6 and I keep getting an unrecognized
  2. //class error, or output. The program terminates, but never renders. I've tried
  3. //exporting it as .java and Mac OS X application and it comes up damaged or incomplete.
  4. //Here is the Unix response with javac
  5. //Below is the Eclipse responses
  6. //I'm also getting a annotation must be explicitly implied or something error with
  7. //the new classes.
  8.  
  9.  
  10. USER:gamePackage1 administrator$ javac gameClass1.java
  11. gameClass1.java:8: cannot find symbol
  12. symbol : class Display
  13. location: class gamePackage1.gameClass1
  14. public static Display f = new Display();
  15. ^
  16. gameClass1.java:8: cannot find symbol
  17. symbol : class Display
  18. location: class gamePackage1.gameClass1
  19. public static Display f = new Display();
  20.  
  21. //
  22. //
  23. //THIS IS ECLIPSE DEBUGGING OUTPUT 1 OF 2
  24. //
  25. //
  26.  
  27. Display at localhost:65190
  28. Thread [main] (Suspended (exception ClassNotFoundException))
  29. owns: Launcher$AppClassLoader (id=22)
  30. URLClassLoader$1.run() line: 202
  31. AccessController.doPrivileged(PrivilegedExceptionAction<T>, AccessControlContext) line: not available [native method]
  32. Launcher$AppClassLoader(URLClassLoader).findClass(String) line: 190
  33. Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line: 306
  34. Launcher$AppClassLoader.loadClass(String, boolean) line: 301
  35. Launcher$AppClassLoader(ClassLoader).loadClass(String) line: 247
  36. Daemon Thread [Thread-1] (Running)
  37. /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java (Dec 18, 2014, 2:01:23 AM)
  38. //
  39. //
  40. //THIS IS ECLIPSE OUTPUT 2 OF 2
  41. //
  42. //
  43. Exception in thread "main" java.lang.NoClassDefFoundError: Display
  44. Caused by: java.lang.ClassNotFoundException: Display
  45. at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
  46. at java.security.AccessController.doPrivileged(Native Method)
  47. at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
  48. at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
  49. at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
  50. at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
  51. //
  52. //
  53. //HERE IS MY CODE 1 OF 2
  54. //
  55. //
  56. package gamePackage1;
  57.  
  58. import javax.swing.JFrame;
  59.  
  60.  
  61. public class gameClass1 {
  62.  
  63. public static Display f = new Display();
  64.  
  65. public static int w = 600;
  66.  
  67. public static int h = 400;
  68.  
  69. static void main(String args[]) {
  70.  
  71. f.setSize(w, h);
  72. f.setResizable(true);
  73. f.setVisible(true);
  74. f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  75. f.setTitle("JavaGame");
  76. f.setLocationRelativeTo(null);
  77. System.out.println("Window Coherent...");
  78. }
  79. }
  80. //
  81. //
  82. //HERE IS MY CODE 2 OF 2
  83. //
  84. //
  85. package gamePackage1;
  86.  
  87. import javax.swing.JFrame;
  88.  
  89. public class Display extends JFrame{
  90.  
  91. /**
  92. *
  93. */
  94. private static final long serialVersionUID = 1L;
  95.  
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement