OpenGL Java and C++

Im in a Java class in school and comming soon we have to make a game. For quite some time Ive been working on a full OpenGL engine in C++ on Linux(no Linux API called only GL). Is there a way I can write Java Lib files for my project so I can still use my C++ code? Is it going to be a problem my school uses win or will I just have to compile DLL’s there? Is it even worth it to use OpenGL with Java?


You can write a Java Native Interface .dll to bind to your existing code. This is a pain and prone to many woes.

What you should really do is investigate the Lightweight Java Game Library ( where we’ve largely done all the horrible stuff for you.

Version 0.6 alpha out shortly with a bunch of fixes.

If you’re interested in Java game development using OpenGL (or just Java game development in general) please come and visit our friendly crowd down at

We know how to get performance, smoothness, and professionalism out of Java finally, so it’s probably worth asking questions in there.


Is it even worth it to use OpenGL with Java?

Of course it is. As Cas pointed out, you should definitely check out LWJGL.

If you’re a comparison shopper, you may also want to check out GL4Java.

Also, a member of Sun’s Java team, Apple’s java team, and will be presenting a new high performance OpenGL Java binding will be presented at the JavaOne conference in June:


[This message has been edited by ckline (edited 04-05-2003).]

[This message has been edited by ckline (edited 04-05-2003).]

I’d also like to ask you all to Vote for Structs or we’ll never see the same performance and ease-of-use as you get in C. You know it makes sense! (If you don’t understand the RFE then vote for it anyway please! You’ll be doing us all a huge favour even if you don’t know why)


I tryed lwjgl at school and on my comp. My comp gives me this
[nuke@NUKE lwjgl-0.5]$ java -cp examples.jar lwjgl.jar MovingStarBitmaps
Exception in thread “main” java.lang.NoClassDefFoundError: lwjgl/jar

I cannt put the ; in because in linux that means another command. At school it couldnt resize the window, probly because of the permissions the only OGL apps that worked there was SDL.

GL4Java never worked for me. It seems that sun is going to put OGL into java that seems kool.