Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (120)
games submitted by our members
Games in WIP (577)
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  
  IntelliJIdea JOGL export jar not working  (Read 2073 times)
0 Members and 1 Guest are viewing this topic.
Offline roland
« Posted 2010-10-12 10:34:17 »

Hi, I've managed to make a triangle show up with JOGL, but when I try to build artifact and run the jar that is made, nothing happens when I double click on it.

I am using jogl-2.0-pre-20101001-windows-i586


This is the output when I open it with the console:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
C:\Java projects\IntelliJIdea\Project3\out\artifacts\unnamed>java -jar unnamed.jar
Exception in thread "main" java.lang.NoClassDefFoundError: javax/media/opengl/GL
EventListener
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(Unknown Source)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$000(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
Caused by: java.lang.ClassNotFoundException: javax.media.opengl.GLEventListener
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 12 more
Could not find the main class: CMain. Program will exit.



Can someone help me fix this?
thanks,
roland
Offline gouessej
« Reply #1 - Posted 2010-10-12 19:59:51 »

Hi

The JOGL JAR must be in your classpath. You should rather do something like this:
1  
java -classpath jogl.jar:gluegen-rt.jar:unnamed.jar -Djava.library.path=where_the_DLL_are YOURMAINCLASS

Offline roland
« Reply #2 - Posted 2010-10-13 02:56:59 »

Thanks for the help. Now when i run it with the console it doesnt say it can't find the JOGL libraries but it says


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
C:\Java projects\JOGL LIB\jogl-2.0-pre-20101001-windows-i586\lib>java -jar
 unnamed.jar
Exception in thread "main" java.lang.NoClassDefFoundError: CMain
Caused by: java.lang.ClassNotFoundException: CMain
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: CMain. Program will exit.




In the classpath edit box i put "jogl.all.jar:gluegen-rt.jar:nativewindow.all.jar:unnamed.jar"
in the main class edit box i put "CMain"

when I pressed run in the IDE this is what came up in the console before displaying the triangle

1  
"C:\Program Files\Java\jdk1.6.0_21\bin\java" -Didea.launcher.port=7532 "-Didea.launcher.bin.path=C:\Program Files\IntelliJ IDEA Community Edition 9.0.3\bin" -Dfile.encoding=windows-1252 -classpath "C:\Program Files\Java\jdk1.6.0_21\jre\lib\alt-rt.jar;C:\Program Files\Java\jdk1.6.0_21\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.6.0_21\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.6.0_21\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.6.0_21\jre\lib\jce.jar;C:\Program Files\Java\jdk1.6.0_21\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.6.0_21\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.6.0_21\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.6.0_21\jre\lib\resources.jar;C:\Program Files\Java\jdk1.6.0_21\jre\lib\rt.jar;C:\Program Files\Java\jdk1.6.0_21\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.6.0_21\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.6.0_21\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.6.0_21\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.6.0_21\jre\lib\ext\sunpkcs11.jar;C:\Java projects\IntelliJIdea\Project3\out\production\Project3;C:\Java projects\JOGL LIB\jogl-2.0-pre-20101001-windows-i586\lib\gluegen-rt.jar;C:\Java projects\JOGL LIB\jogl-2.0-pre-20101001-windows-i586\lib\jogl.all.jar;C:\Java projects\JOGL LIB\jogl-2.0-pre-20101001-windows-i586\lib\nativewindow.all.jar;C:\Program Files\IntelliJ IDEA Community Edition 9.0.3\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain CMain


Can you please tell me what I should do next to fix this?
sorry I don't understand why this is happening.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline gouessej
« Reply #3 - Posted 2010-10-14 23:00:59 »

Do it is command-line and sorry, change the file separator as you're on Windows and I'm on Linux. Replace the ":" by ";". Don't use an IDE if you don't understand how Java works. An IDE saves a lot of time if you really know what happens underneath.

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.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (43 views)
2014-10-16 15:22:06

Norakomi (33 views)
2014-10-16 15:20:20

lcass (37 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (66 views)
2014-10-14 00:35:47

TehJavaDev (59 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (86 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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
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!