any help greatly appreciated.
Problem: Ubuntu 11.10 not playing nice with Java's JOGL
Summary of what has been established:
- JDK ok
- Environment variables ok
- JOGL Jars and lib ok
- Test file used ok
- Very unlikely to be EBKAC
- file permissions ok
- Problem caused by Ubuntu 11.10, (can has help?)
- Potential solution - how do you install libjogl-java_1.1.1+dak1.orig.tar.gz ?
Details of what has been established:
JOGL was working fine with Ubuntu 11.04. Test file "T1.java" displayed a wireframe cube correctly. After updating Ubuntu to 11.10, when run in Eclipse the JOGL frame always froze not showing any JOGL goodness. I tried running a Java applet to check if java was broken, it worked fine. Java not broken. Checked my jogl user library in Eclipse, looks fine. Native library set correctly for all jars. I tried running the file in a terminal
cd ~/workspace/projectname/src/packagename/
javac T1.java
and got 32 errors complaining that the packages could not be found. At this point I realised this is NOT an eclipse problem.
I changed environment variables at /etc/environment and /etc/profile, such that running:
echo $PATH
echo $CLASSPATH
and
echo $JAVA_HOME
all display ~/librambo/jar and ~/librambo/lib as they should (plus the JDK correctly appeared in PATH) (~/librambo is /home/rambo/librambo , rambo = username)
I tried putting the simple "T1.java" inside ~/librambo/jar and javac 'ing it from there, same problem. Then I tried:
javac -classpath jogl.all.jar T1.java
to determine if it would reduce the number of errors, and it claimed "error reading jogl.all.jar; error in opening zip file"
After extracting the jar file, it compiled but would not run. Running
ldd *.so
in the terminal, I saw it lacked "libjawt.so", as it complained "not found". After finding that library file and copying it into the ~/librambo/jar folder, it (ldd *.so) then complained about several other library packages, such as libmawt.so, libjvm.so etc. After they also joined the horrendous pool of files congregating in ~/librambo/jar, upon ldd'ing again it complained it could now not find libjawt.so - but I just 'fixed' that problem...
I also "gksu nautilus" 'd my way over to them jar files, and set their permissions to read/write for all users, and allowed them to be ran as executables.
I had been using sun-java-6, so in paranoia I decided to remove the other java SDKs in /usr/lib/jvm to prevent interference from there being too many jar files confusing it. Same problem. Installed JDK1.7.0, cleared out ~/librambo/jar leaving only the 4 jars (and T1.java), wouldn't compile - same 32 errors again. (I used "sudo update-alternatives --config java" to set the java version, I used java -version to check what version I'm using so thats not the problem =p)
THis time downloaded jogl-linux-amd64.7z fresh, within it opened java-jogl-src.zip and copied the contents to /~librambo/jar again to see if I could just get it to work in this folder, 100 errors because the directory structure didn't match.
I have trawled much internets looking for answers for days, and I think I may finally have found it:
https://launchpad.net/ubuntu/oneiric/+source/libjogl-java/1.1.1+dak1-10
it says in the change log "Update the patch to set java.library.path" which is in keeping with an error I encountered (at some point). Unfortunately, when I download libjogl-java_1.1.1+dak1.orig.tar.gz and opened it, I realised I have no idea what I'm supposed to be doing with the contents. Could anyone tell me what to do to 'install' them?
Alternatively, here is the appendix, which contains the file hierarchy, /etc/environment setup, the 32 errors output, and a list of references which I have checked already.
////////////////////////////////////////
APPENDIX
////////////////////////////////////////
FILE HIERARCHY
- /home/rambo/librambo/jar/ gluegen-rt.jar
- /home/rambo/librambo/jar/ jogl.all.jar
- /home/rambo/librambo/jar/ jogl-all-natives-linux-amd64.jar
- /home/rambo/librambo/jar/ newt.event.jar
- /home/rambo/librambo/jar/ T1.java #and a host of other files, have since been removed, thus the 32 errors came back.
- /home/rambo/librambo/lib/ libgluegen-rt.so
- /home/rambo/librambo/lib/ libjogl_desktop.so
- /home/rambo/librambo/lib/ libjogl_mobile.so
- /home/rambo/librambo/lib/ libnativewindow_awt.so
- /home/rambo/librambo/lib/ libnativewindow_x11.so
- /home/rambo/librambo/lib/ libnewt.so
ENVIRONMENT VARIABLES
- PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:~/.rvm/bin:/home/rambo/librambo/jar:/home/rambo/librambo/lib:/usr/lib/jvm/jdk1.7.0/bin:/usr/lib/jvm/jdk1.7.0/lib:/usr/lib/jvm/jdk1.7.0/jre/lib/amd64"
- JAVA_HOME="/usr/lib/jvm/jdk1.7.0/bin:/usr/lib/jvm/jdk1.7.0/lib:/usr/lib/jvm/jdk1.7.0/jre/lib/amd64:/home/rambo/librambo/jar:/home/rambo/librambo/lib"
- CLASSPATH="/usr/lib/jvm/jdk1.7.0/bin:/usr/lib/jvm/jdk1.7.0/lib:/usr/lib/jvm/jdk1.7.0/jre/lib/amd64:/home/rambo/librambo/jar:/home/rambo/librambo/lib"
32 ERRORS
rambo@rambo-ThinkPad-SL510:~/librambo/jar$ javac T1.java
T1.java:3: package javax.media.opengl does not exist
import javax.media.opengl.*;
^
T1.java:4: package javax.media.opengl.awt does not exist
import javax.media.opengl.awt.GLCanvas;
^
T1.java:5: package com.jogamp.opengl.util does not exist
import com.jogamp.opengl.util.*;
^
T1.java:6: package javax.media.opengl.glu does not exist
import javax.media.opengl.glu.GLU;
^
T1.java:7: package com.jogamp.opengl.util.gl2 does not exist
import com.jogamp.opengl.util.gl2.GLUT;
^
T1.java:9: cannot find symbol
symbol: class GLEventListener
public class T1 extends Frame implements GLEventListener, ActionListener {
^
T1.java:17: cannot find symbol
symbol : class GLCanvas
location: class T1
private GLCanvas canvas;
^
T1.java:75: cannot find symbol
symbol : class GLAutoDrawable
location: class T1
public void display(GLAutoDrawable drawable) {
^
T1.java:81: cannot find symbol
symbol : class GLAutoDrawable
location: class T1
public void dispose(GLAutoDrawable drawable) {
^
T1.java:85: cannot find symbol
symbol : class GLAutoDrawable
location: class T1
public void init (GLAutoDrawable drawable) {
^
T1.java:92: cannot find symbol
symbol : class GLAutoDrawable
location: class T1
public void reshape (GLAutoDrawable drawable, int x, int y, int width, int height) {
^
T1.java:115: cannot find symbol
symbol : class GLU
location: class Scene
private GLU glu = new GLU();
^
T1.java:116: cannot find symbol
symbol : class GLUT
location: class Scene
private GLUT glut = new GLUT();
^
T1.java:133: cannot find symbol
symbol : class GL2
location: class Scene
public void render(GL2 gl) {
^
T1.java:145: cannot find symbol
symbol : class GL2
location: class Scene
private void drawAxes(GL2 gl) {
^
T1.java:20: cannot find symbol
symbol : variable GLProfile
location: class T1
GLProfile.initSingleton(true);
^
T1.java:29: cannot find symbol
symbol : class GLProfile
location: class T1
GLProfile glp = GLProfile.getDefault();
^
T1.java:29: cannot find symbol
symbol : variable GLProfile
location: class T1
GLProfile glp = GLProfile.getDefault();
^
T1.java:30: cannot find symbol
symbol : class GLCapabilities
location: class T1
GLCapabilities caps = new GLCapabilities(glp);
^
T1.java:30: cannot find symbol
symbol : class GLCapabilities
location: class T1
GLCapabilities caps = new GLCapabilities(glp);
^
T1.java:31: cannot find symbol
symbol : class GLCanvas
location: class T1
canvas = new GLCanvas(caps);
^
T1.java:56: cannot find symbol
symbol : class FPSAnimator
location: class T1
FPSAnimator animator = new FPSAnimator(canvas, 60);
^
T1.java:56: cannot find symbol
symbol : class FPSAnimator
location: class T1
FPSAnimator animator = new FPSAnimator(canvas, 60);
^
T1.java:76: cannot find symbol
symbol : class GL2
location: class T1
GL2 gl = drawable.getGL().getGL2();
^
T1.java:86: cannot find symbol
symbol : class GL2
location: class T1
GL2 gl = drawable.getGL().getGL2();
^
T1.java:93: cannot find symbol
symbol : class GL2
location: class T1
GL2 gl = drawable.getGL().getGL2();
^
T1.java:99: cannot find symbol
symbol : variable GL2
location: class T1
gl.glMatrixMode(GL2.GL_PROJECTION);
^
T1.java:108: cannot find symbol
symbol : variable GL2
location: class T1
gl.glMatrixMode(GL2.GL_MODELVIEW);
^
T1.java:115: cannot find symbol
symbol : class GLU
location: class Scene
private GLU glu = new GLU();
^
T1.java:116: cannot find symbol
symbol : class GLUT
location: class Scene
private GLUT glut = new GLUT();
^
T1.java:134: cannot find symbol
symbol : variable GL2
location: class Scene
gl.glClear(GL2.GL_COLOR_BUFFER_BIT);
^
T1.java:148: cannot find symbol
symbol : variable GL2
location: class Scene
gl.glBegin(GL2.GL_LINES);
^
32 errors
REFERENCES
(Truncated list)
- http://www.leolol.com/drupal/game-programming
- Ant build classpath jar generates "error in opening zip file"
- http://forum.worldwindcentral.com/archive/index.php?t-10146.html
- (Jogamp wiki pages, for installing Jogamp on Ubuntu 64bit)
- JOGL does not work after reinstalling ubuntu
- A graphics lecturer at my University
- T** C*******, (anonymous) Vi wielding TDDaholic
- http://www.google.com
////////////////////////////////////////
UPDATES
////////////////////////////////////////
DAY 5 of java jogl headache update
PROGRESS!! =D
Now only 20 errors related to... Android? =S
So I started a new folder /home/rambo/libme
I downloaded:
- jogl-linux-amd64.7z 16-Sep-2011 13:50 7.0M
- gluegen-linux-amd64.7z 16-Sep-2011 04:53 735K
from:
http://jogamp.org/deployment/jogamp-current/archive/jogamp-linux-amd64/
This time, i unpacked the 7zip files and saw a src zip folder in each. I copied the contents of both into libme, there were no overwrites - they share a similar folder structure though.
Then I changed the environment variables to point at libme. Then I moved T1.java into libme. Javac of T1 within libme gave the following complaint:
rambo@rambo-ThinkPad-SL510:~/libme$ javac T1.java
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:30: package android.content does not exist
import android.content.*;
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:31: package android.content.pm does not exist
import android.content.pm.*;
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:32: package android.util does not exist
import android.util.Log;
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:37: cannot find symbol
symbol : class PackageInfo
location: class jogamp.common.os.android.PackageInfoUtil
public static final PackageInfo getPackageInfo(String packageName) {
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:41: cannot find symbol
symbol : class Context
location: class jogamp.common.os.android.PackageInfoUtil
public static final PackageInfo getPackageInfo(Context ctx, String packageName) {
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:41: cannot find symbol
symbol : class PackageInfo
location: class jogamp.common.os.android.PackageInfoUtil
public static final PackageInfo getPackageInfo(Context ctx, String packageName) {
^
/home/rambo/libme/jogamp/common/os/android/StaticContext.java:30: package android.content does not exist
import android.content.*;
^
/home/rambo/libme/jogamp/common/os/android/StaticContext.java:31: package android.util does not exist
import android.util.Log;
^
/home/rambo/libme/jogamp/common/os/android/StaticContext.java:34: cannot find symbol
symbol : class Context
location: class jogamp.common.os.android.StaticContext
private static Context context = null;
^
/home/rambo/libme/jogamp/common/os/android/StaticContext.java:37: cannot find symbol
symbol : class Context
location: class jogamp.common.os.android.StaticContext
public static final synchronized void setContext(Context ctx) {
^
/home/rambo/libme/jogamp/common/os/android/StaticContext.java:41: cannot find symbol
symbol : class Context
location: class jogamp.common.os.android.StaticContext
public static final synchronized Context getContext() {
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:44: cannot find symbol
symbol : class PackageInfo
location: class jogamp.common.os.android.PackageInfoUtil
final PackageInfo pi = ctx.getPackageManager().getPackageInfo(packageName, PackageManager.GET_META_DATA);
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:44: cannot find symbol
symbol : variable PackageManager
location: class jogamp.common.os.android.PackageInfoUtil
final PackageInfo pi = ctx.getPackageManager().getPackageInfo(packageName, PackageManager.GET_META_DATA);
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:45: cannot find symbol
symbol : variable Log
location: class jogamp.common.os.android.PackageInfoUtil
if(DEBUG) Log.d(MD.TAG, "getPackageInfo("+packageName+"): "+pi);
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:47: cannot find symbol
symbol : variable Log
location: class jogamp.common.os.android.PackageInfoUtil
} catch (Exception e) { if(DEBUG) { Log.d(MD.TAG, "getPackageInfo("+packageName+")", e); } }
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:49: cannot find symbol
symbol : variable Log
location: class jogamp.common.os.android.PackageInfoUtil
if(DEBUG) Log.d(MD.TAG, "getPackageInfo("+packageName+"): NULL");
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:54: cannot find symbol
symbol : class PackageInfo
location: class jogamp.common.os.android.PackageInfoUtil
final PackageInfo pInfo = getPackageInfo(packageName);
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:58: cannot find symbol
symbol : class PackageInfo
location: class jogamp.common.os.android.PackageInfoUtil
final PackageInfo pInfo = getPackageInfo(packageName);
^
/home/rambo/libme/jogamp/common/os/android/PackageInfoUtil.java:60: cannot find symbol
symbol : variable Log
location: class jogamp.common.os.android.PackageInfoUtil
if(DEBUG) Log.d(MD.TAG, "getPackageInfoVersionName("+packageName+"): "+s);
^
/home/rambo/libme/jogamp/common/os/android/StaticContext.java:38: cannot find symbol
symbol : variable Log
location: class jogamp.common.os.android.StaticContext
if(DEBUG) Log.d(MD.TAG, "setContext("+ctx+")");
^
Note: /home/rambo/libme/javax/media/opengl/awt/GLCanvas.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
20 errors
Deleting the android folder didn't help. (If i use just the jogl src and not the gluegen, it gives 100 errors. Adding the source from joal does nothing either)
openGL test
rambo@rambo-ThinkPad-SL510:~$ /usr/lib/nux/unity_support_test -p
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: ATI Mobility Radeon HD 4500 Series
OpenGL version string: 3.3.11005 Compatibility Profile Context
Not software rendered: yes
Not blacklisted: yes
GLX fbconfig: yes
GLX texture from pixmap: yes
GL npot or rect textures: yes
GL vertex program: yes
GL fragment program: yes
GL vertex buffer object: yes
GL framebuffer object: yes
GL version is 1.4+: yes
Unity 3D supported: yes