Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Newbie help required

22 views
Skip to first unread message

lk

unread,
Jul 13, 2008, 4:10:16 AM7/13/08
to
Hi all

Hope someone can help. I'm just getting into Java and I'm interested in
using the openGL api. The problem is, despite following the instructions
on:

http://www.cs.umd.edu/~meesh/kmconroy/JOGLTutorial/

I can't seem to get NetBeans (the IDE my course insists we use) to recognise
jogl.
This in as much as I'm getting the following errors:

init:
deps-jar:
Compiling 1 source file to D:\Documents and
Settings\rm\JavaLibrary2\build\classes
D:\Documents and Settings\rm\JavaLibrary2\src\JavaRenderer.java:1: package
javax.media.opengl does not exist
import javax.media.opengl.GL;
D:\Documents and Settings\rm\JavaLibrary2\src\JavaRenderer.java:2: package
javax.media.opengl does not exist
import javax.media.opengl.GLEventListener;
D:\Documents and Settings\rm\JavaLibrary2\src\JavaRenderer.java:3: package
javax.media.opengl does not exist
import javax.media.opengl.GLAutoDrawable;
D:\Documents and Settings\rm\JavaLibrary2\src\JavaRenderer.java:4: package
javax.media.opengl.glu does not exist
import javax.media.opengl.glu.GLU;
D:\Documents and Settings\rm\JavaLibrary2\src\JavaRenderer.java:10: cannot
find symbol
symbol: class GLEventListener
public class JavaRenderer implements GLEventListener
5 errors
BUILD FAILED (total time: 0 seconds)

There's obviously something I've missed - can anyone help?


Wolfgang Draxinger

unread,
Jul 13, 2008, 5:40:27 AM7/13/08
to
lk wrote:

> There's obviously something I've missed - can anyone help?

JOGL isn't part of the core Java SDK. You've to install it
additionally. Follow the instructions on the JOGL homepage how
to install it into your SDK installation.

Wolfgang Draxinger
--
E-Mail address works, Jabber: hexa...@jabber.org, ICQ: 134682867

Jonathan Campbell

unread,
Jul 13, 2008, 7:09:29 AM7/13/08
to
lk wrote:
> Hi all
>
> Hope someone can help. I'm just getting into Java and I'm interested in
> using the openGL api. The problem is, despite following the instructions
> on:
>
> http://www.cs.umd.edu/~meesh/kmconroy/JOGLTutorial/
>
> I can't seem to get NetBeans (the IDE my course insists we use) to recognise
> jogl.
> This in as much as I'm getting the following errors:
>
> init:
> deps-jar:
> Compiling 1 source file to D:\Documents and
> Settings\rm\JavaLibrary2\build\classes
> D:\Documents and Settings\rm\JavaLibrary2\src\JavaRenderer.java:1: package
> javax.media.opengl does not exist

[...]

>
> There's obviously something I've missed - can anyone help?
>
>

I sympathise. One of the hardest parts of teaching stuff like this (and
the initial stages learning it) is the initial configuration stage and
getting sys. admins. to set up labs properly. Or, pointing the finger at
myself, writing unambiguous installation and setup instructions for
students :(

It doesn't help that pre-validation software is still floating around
the internet, i.e. pre

import javax.media.opengl.*;

A year ago, I installed and setup JOGL on both Linux and Windows. AFAIK,
the helps here helped (but which I cannot remember):

http://www.felixgers.de/teaching/jogl/JOGLInstall.html

On both systems there were tripwires (incidentally contributed to by
multiple Java systems on the Windows system). Another problem was
finding the installation download. OTOH, all this was done in a spirit
of impatience and haste.

Might you consider using command line and javac (compiler command) and
java (interpreter execute command) for /initial/ testing --- just
removes another source of confusion? Find where java and javac are and
put those directories in the path; or simply use the full pathnames:

c:\program ...\java\jdkxyz\bin\javac prog.java

c:\prog.....\bin\java prog

And start the simplest possible test program, something like:

//package com.genedavissoftware.jogl.ch1;

import javax.media.opengl.*;


/**
* Testing to see if native and java libraries are installed correctly.
JOGL
* is installed properly only when the 'jogl.jar' and the native library,
* named somthing like 'libjogl.jnilib' or 'jogl.dll', are both installed.
*
* If the native library is not accessible, this program will throw a
* java.lang.UnsatisfiedLinkError Exception.
*
* If the jar is not installed in the classpath, then this will not even
* compile. It will say something similar to:
* "package net.java.games.jogl does not exist"
*
* When this class compiles and runs without exceptions, you are ready
* to continue with learning JOGL.
*/
public class HelloWorld {
public static void main (String args[]) {
try {

//check for native library
System.loadLibrary("jogl");
System.out.println(
"Hello World! (The native libraries are
installed.)"
);

//check for jogl jar
new GLCapabilities();
System.out.println(
"Hello JOGL! (The jar appears to be
available.)"
);

} catch (Exception e) {
System.out.println(e);
}
}
}

There are unsorted and unfiltered links at:

http://www.jgcampbell.com/links/jogl.html

Andrew Davison's stuff is good, but not totally introductory.

Gene Davis's book may be out of date, but he has placed updated software
/somewhere/.

Best regards,

Jon C.

lk

unread,
Jul 13, 2008, 10:17:46 AM7/13/08
to

"Wolfgang Draxinger" <wdrax...@darkstargames.de> wrote in message
news:b5vok5-...@darkstargames.dnsalias.net...

Thanks - but that's precisely what I've done and it's not working.


jbwest

unread,
Jul 13, 2008, 11:20:12 PM7/13/08
to

"lk" <gofy...@wrong.address.com> wrote in message
news:4879b85c$0$26088$db0f...@news.zen.co.uk...

The jogl jars aren't in your $CLASSPATH
Add them. You'll need to add the DLL's to your $PATH to run, also.

jbw


Mike Reid

unread,
Jul 14, 2008, 3:14:55 PM7/14/08
to
Once you have JOGL installed in the correct places you might like to
use the NetBeans OpenGL plugin. NetBeans is a great tool for OpenGL,
with the plugin it integrates JOGL nicely and will also do things such
as syntax highlight your shader code (useful once you get to that
stage).

You can get the plugin using the plugin manager in NetBeans 6. Here
are some links in case you can't get that to work.
http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=3260
https://netbeans-opengl-pack.dev.java.net/
http://blogs.sun.com/jonasdias/entry/developing_opengl_with_netbeans_6

Cheers,
Mike

lk

unread,
Jul 15, 2008, 1:19:26 PM7/15/08
to

"Mike Reid" <Michae...@argonautltd.co.nz> wrote in message
news:58f3c087-554d-49e6...@m3g2000hsc.googlegroups.com...

Thanks. Thus far, I've put:
jogl.dll in wherever\bin\
jogl.jar in wherever\lib\ext

and amended $CLASSPATH and $PATH but NetBeans (admittedly 4.1) has refused
to play ball. I'm forced to use NetBeans 4.1 thanks to my course.
However I do have another box I can install NB6 on so I'll see if that
works.

Mike Reid

unread,
Jul 16, 2008, 4:33:20 PM7/16/08
to
Netbeans 4.1! That's Bronze Age technology. Do they have a suitable
abacus to run it on? Netbeans 6.1 has come a very long way since 4.1.

Just to comfirm what you ought to be doing (you appear to be doing
this but I'm just checking):

* native libraries must be located in the path defined by the Java
system property "java.library.path". This should include your $PATH
(or %PATH% for those unlucky enough to be using Windows). The native
libraries (DLLs, or *.so) must be located somewhere on this path.

* the JAR file must be located on the Java classpath.

You can view this property with the following program (which must be
contained in a file called "CheckPaths.java"):

public class CheckPaths {
public static void main(String[] args) {
System.out.println("java.library.path = " +
System.getProperty("java.library.path"));
System.out.println("java.class.path = " +
System.getProperty("java.class.path"));
}
}


--------
lk: Wrote

0 new messages