Hello Guest

JCreator LE issues

  • 16 Replies
  • 29625 Views
JCreator LE issues
« on: January 05, 2011, 10:19:00 »
Hello,

So this is the error I'm getting:

--------------------Configuration: game - JDK version 1.6.0_16 new tool - <Default>--------------------
java.lang.NoClassDefFoundError: command
Caused by: java.lang.ClassNotFoundException: command
   at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: command.  Program will exit.
Exception in thread "main"
Process completed.


I tried setting up the IDE according to http://www.lwjgl.org/wiki/index.php?title=Setting_Up_LWJGL_with_JCreator
and also edited the parameters in the tools for running the program as:

-classpath "$[ClassPath]" -Djava.library.path= "C:\lwjgl-2.6\native\windows" $[JavaClass]

which I found on this page http://lwjgl.org/forum/index.php?topic=1300.0

and I tried to compile the code on this page http://www.lwjgl.org/wiki/index.php?title=Setting_Up_LWJGL_with_NetBeans
which did compile but then I got the error when trying to run it?

Re: JCreator LE issues
« Reply #1 on: January 05, 2011, 11:15:01 »
Do not put a space between = and " here:
-Djava.library.path="C:\lwjgl-2.6\native\windows"

Not sure if that will fix it.  Also, if you go to that directory, are the DLL's there?

Might need to search around the JCreator website for how to add a Java VM Option.  I copied & pasted that tutorial from the very outdated one on the main page, and as I don't use JCreator, I have no idea how you are supposed to specify VM options.  I can't search right now, but I'll try searching later today.
cool story, bro

Re: JCreator LE issues
« Reply #2 on: January 05, 2011, 11:42:08 »
Fixed the space and also checked the DLL's but no luck.


EDIT:: Tried searching about JVM in the help files of Jcreator as well as Google but no luck either. jcreator talks about the classpath stuff and I already edited that.
« Last Edit: January 05, 2011, 11:47:11 by verthex »

*

Offline kappa

  • *****
  • 1319
Re: JCreator LE issues
« Reply #3 on: January 05, 2011, 11:47:17 »
hmm, error seems to suggest that java can't find your main class called 'command' so doesn't look like an LWJGL issue. Check that your main class is properly setup/created in the IDE.

Re: JCreator LE issues
« Reply #4 on: January 05, 2011, 12:02:34 »
Thats the one thing not one tutorial seems to show and I set that up myself. I'm not sure how I should setup the example code I posted the link to above. Could you go through that with me?


I tried setting up the project as an empty project using a file called a Main class and got this error:

--------------------Configuration: Main - JDK version 1.6.0_16 <Default> - <Default>--------------------
Keys:
down  - Shrink
up    - Grow
left  - Rotate left
right - Rotate right
esc   - Exit
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.lwjgl.opengl.Display
   at game.destroy(game.java:90)
   at game.main(game.java:55)

Process completed.
« Last Edit: January 05, 2011, 12:11:51 by verthex »

*

Offline kappa

  • *****
  • 1319
Re: JCreator LE issues
« Reply #5 on: January 05, 2011, 12:17:55 »
ok now that error simply means that lwjgl.jar is not setup correctly as an external jar, double check that.

Re: JCreator LE issues
« Reply #6 on: January 05, 2011, 12:23:21 »
I checked my "required libraries" under project settings and its in the list. Is that what you mean by external?


EDIT:: I got that last error because I didn't have my parameters checked in the JDK tools section.

I recompiled and ran and got the error I first posted.
« Last Edit: January 05, 2011, 12:26:16 by verthex »

*

Offline kappa

  • *****
  • 1319
Re: JCreator LE issues
« Reply #7 on: January 05, 2011, 12:26:46 »
well to setup LWJGL there are two steps.

1) the java part, lwjgl.jar must be on the classpath, its a 3rd party library so usually added as an external jar.
2) the native part, this is done using "-Djava.library.path" to point to the folder containing the native files.

The error you get seems to suggest that step one is not setup correctly.

Re: JCreator LE issues
« Reply #8 on: January 05, 2011, 12:29:43 »
This is my complete classpath and its in there?
C:\Documents and Settings\c\My Documents\JCreator LE\MyProjects;C:\lwjgl-2.6;C:\lwjgl-2.6\jar\AppleJavaExtensions.jar;C:\lwjgl-2.6\jar\jinput.jar;C:\lwjgl-2.6\jar\lwjgl.jar;C:\lwjgl-2.6\jar\lwjgl_test.jar;C:\lwjgl-2.6\jar\lwjgl_util.jar;C:\lwjgl-2.6\jar\lwjgl_util_applet.jar;C:\lwjgl-2.6\jar\lwjgl-debug.jar;C:\lwjgl-2.6\jar\lzma.jar;C:\Program Files\Java\jdk1.6.0_16\jre\lib\rt.jar;C:\Program Files\Java\jdk1.6.0_16\lib\dt.jar;C:\Program Files\Java\jdk1.6.0_16\lib\tools.jar;C:\Program Files\Java\jdk1.6.0_16\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.6.0_16\jre\lib\ext\j3dcore.jar;C:\Program Files\Java\jdk1.6.0_16\jre\lib\ext\j3dutils.jar;C:\Program Files\Java\jdk1.6.0_16\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.6.0_16\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.6.0_16\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.6.0_16\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.6.0_16\jre\lib\ext\vecmath.jar

*

Offline kappa

  • *****
  • 1319
Re: JCreator LE issues
« Reply #9 on: January 05, 2011, 12:41:19 »
hmm, you've added all the LWJGL jars to the classpath!  :o

you shouldn't do that and you only need to add lwjgl.jar, try removing all the other lwjgl jars.

Re: JCreator LE issues
« Reply #10 on: January 05, 2011, 12:48:17 »
I only added the lwjgl.jar and in the "add path" settings I added the path to C:\lwjgl-2.6 and got these errors when compiling:

package org.lwjgl.util.glu does not exist

cannot find symbol method gluOrtho2D(float,int,float,int)


edit:: I added the lwjgl_util.jar file too and then I got the first error I posted.
« Last Edit: January 05, 2011, 13:03:50 by verthex »

*

Offline kappa

  • *****
  • 1319
Re: JCreator LE issues
« Reply #11 on: January 05, 2011, 13:28:09 »
the error in your first post? or the Could not initialize class org.lwjgl.opengl.Display one?

Re: JCreator LE issues
« Reply #12 on: January 05, 2011, 13:41:53 »
This one.

--------------------Configuration: game - JDK version 1.6.0_16 new tool - <Default>--------------------
java.lang.NoClassDefFoundError: command
Caused by: java.lang.ClassNotFoundException: command
   at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: command.  Program will exit.
Exception in thread "main"
Process completed.

*

Offline kappa

  • *****
  • 1319
Re: JCreator LE issues
« Reply #13 on: January 05, 2011, 13:45:26 »
its still looking for a class named 'command' and your getting that error because its not finding it. As mentioned this doesn't relate to any LWJGL specific issue and you should check the way you are launching the file from your IDE. Personally I use Eclipse, so can't really tell why your IDE would produce such an issue.
« Last Edit: January 05, 2011, 13:47:05 by kappa »

Re: JCreator LE issues
« Reply #14 on: January 05, 2011, 13:57:20 »
I did get this to work with eclipse but its a memory hog. The problem I have with eclipse so far is that I tried to compile a file after changing a simple thing like the color of a cube and I cannot get it to recompile after the first try. I guess this would be off topic but anyways how do you think I would go about finding this "command" problem. The word is no where in the code and I tried googling that last error and I must be the first person ever to get this error since it led back here.