Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (497)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  LWJGL Linking Libraries  (Read 954 times)
0 Members and 1 Guest are viewing this topic.
Offline ECJava

Junior Member


Medals: 1



« Posted 2013-03-19 17:14:35 »

I am a little confused on why this isn't working but I am trying to get LWJGL to work along side my own library but when I try to use my library which used the LWJGL I always get this error message

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
Exception in thread "main" java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException
   at easycliptest.EasyClipTest.<init>(EasyClipTest.java:18)
   at easycliptest.EasyClipTest.main(EasyClipTest.java:67)
Caused by: java.lang.ClassNotFoundException: org.lwjgl.LWJGLException
   at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
   at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
   ... 2 more
Java Result: 1


The thing about it though is LWJGL works if I just run the a test within the library project Easy Clip that uses LWJGL. If another program is to use Easy Clip as a library and easy clip uses LWJGL, then how can this be done?

Also not sure where this topic goes, I tried registering for LWJGL forums but this question "What is the package + class name that Display inherits from?", is the one I am stuck on. In my opinion that forum has too many security requirements during registration. Seems too much to me.
Offline davedes
« Reply #1 - Posted 2013-03-19 17:29:29 »

I tried registering for LWJGL forums but this question "What is the package + class name that Display inherits from?", is the one I am stuck on. In my opinion that forum has too many security requirements during registration. Seems too much to me.
Hehe; if you are stuck on this basic Object-Oriented programming question then you will probably have a hard time grasping something as complex as game development with LWJGL. Smiley LWJGL is not exactly a beginner-friendly way to make games.

Regarding your problem, if you are developing a library that depends on LWJGL then it will need to be included as a dependency alongside your other projects. The LWJGL jars and natives need to be correctly included in your class-path, otherwise you will get the error you posted.

Some links:
http://www.lwjgl.org/wiki/index.php?title=Setting_Up_LWJGL_with_Eclipse
http://stackoverflow.com/a/10063578

Offline ECJava

Junior Member


Medals: 1



« Reply #2 - Posted 2013-03-19 17:42:47 »

Thanks for making me feel stupid, if it's so basic why don't I know it? Not much of this stuff is taught or spoken of.

I'm also using netbeans 7.3 and it's been kind of a pain to deal with
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline davedes
« Reply #3 - Posted 2013-03-19 18:11:12 »

There is also a guide for NetBeans:
http://www.lwjgl.org/wiki/index.php?title=Setting_Up_LWJGL_with_NetBeans

You can find out what class an object extends (i.e. inherits from) by reading its JavaDoc:
http://lwjgl.org/javadoc/org/lwjgl/opengl/Display.html

Read more about it here:
http://www.ntu.edu.sg/home/ehchua/programming/java/J3c_OOPWrappingUp.html#zz-10.5

Offline ECJava

Junior Member


Medals: 1



« Reply #4 - Posted 2013-03-19 18:14:35 »

Well the thing is I already know all this. But it still doesn't work. I've tried the class path and I've used the VM Options and placed all the right JARs in their own library in netbeans but I still get the error.
Offline gouessej
« Reply #5 - Posted 2013-03-20 12:03:05 »

I think I understand your problem, I had a similar problem under Eclipse, I had to modify my project so that the JARs of my third party libraries become visible outside my project, I used the parameter "exported", I set it to "true". I'm under Netbeans 7.2.1 too, maybe I can find a similar solution for it.

Edit.: Adding LWJGL as a compile-time library into your "ECJava" project should work, no additional step should be necessary.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

BurntPizza (22 views)
2014-09-19 03:14:18

Dwinin (35 views)
2014-09-12 09:08:26

Norakomi (63 views)
2014-09-10 13:57:51

TehJavaDev (90 views)
2014-09-10 06:39:09

Tekkerue (44 views)
2014-09-09 02:24:56

mitcheeb (65 views)
2014-09-08 06:06:29

BurntPizza (48 views)
2014-09-07 01:13:42

Longarmx (35 views)
2014-09-07 01:12:14

Longarmx (40 views)
2014-09-07 01:11:22

Longarmx (37 views)
2014-09-07 01:10:19
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!