Ubuntu/Linux misc. problems: jogl, j3d, netbeans...

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Ubuntu/Linux misc. problems: jogl, j3d, netbeans...

LordSmoke
This post was updated on .
I have been developing JOGL, J3D apps for several years that seem to run fine on OS X and Windows, but I recently learned of problems on Ubuntu/Linux.

I have tested five apps on two versions of Ubuntu (18.04.1, 18.10) and four versions of Java (Oracle 8, OpenJDK 8, OpenJDK 10.0.2, and OpenJDK 11). Ubuntu versions running in VirtualBox 6.0 on Mac OS 10.14.2.

Non-graphics (non-JOGL/J3D) programs work fine. The only graphics programs that work are one version from July 2014 that will run on Oracle Java 8 on Ubuntu 18.10 and another compiled on FEB 2018 that will run on Ubuntu 18.10 on either Oracle Java 8 or OpenJDK 8. Some X11 shutdown errors, but both work.

Hoping to track down the problems one-by-one, I tried compiling on Ubuntu 18.04 using Netbeans 8.2 and Oracle Java 8 (the versions I used on the Mac) and JOGL 2.3.2 from OCT2015 and J3D from APR2015.

But, I get immediate errors. Probably a Netbeans setup issue and the JOGL 2.3.2 and J3D APR2015 libraries are found, but it says various packages do not exist and it cannot find things like...

import com.sun.j3d.utils.geometry.Sphere;
import com.jogamp.opengl.GLProfile;
import com.jogamp.common.nio.Buffers;
import com.jogamp.graph.curve.opengl.RegionRenderer;
import com.jogamp.graph.curve.opengl.RenderState;
import com.jogamp.graph.curve.opengl.TextRegionUtil;
import com.jogamp.graph.geom.SVertex;
import com.jogamp.opengl.DebugGL3;
import static com.jogamp.opengl.GL.GL_BLEND;
import static com.jogamp.opengl.GL.GL_FRONT_AND_BACK;
import static com.jogamp.opengl.GL.GL_ONE_MINUS_SRC_ALPHA;
import static com.jogamp.opengl.GL.GL_SRC_ALPHA;
import static com.jogamp.opengl.GL2GL3.GL_FILL;
import static com.jogamp.opengl.GL2GL3.GL_LINE;
import com.jogamp.opengl.GL3;
import com.jogamp.opengl.GLAutoDrawable;
import com.jogamp.opengl.GLCapabilities;
import com.jogamp.opengl.GLEventListener;
import com.jogamp.opengl.GLException;
import com.jogamp.opengl.GLProfile;
import com.jogamp.opengl.awt.GLCanvas;
import static com.jogamp.opengl.math.FloatUtil.invertMatrix;
import static com.jogamp.opengl.math.FloatUtil.makeIdentity;
import static com.jogamp.opengl.math.FloatUtil.makeRotationEuler;
import static com.jogamp.opengl.math.FloatUtil.makeScale;
import static com.jogamp.opengl.math.FloatUtil.makeTranslation;
import static com.jogamp.opengl.math.FloatUtil.multMatrix;
import static com.jogamp.opengl.math.FloatUtil.multMatrixVec;
import static com.jogamp.opengl.math.FloatUtil.transposeMatrix;
import com.jogamp.opengl.util.FPSAnimator;
import com.jogamp.opengl.util.glsl.ShaderProgram;

I have spent my free time for a number of days testing and worrying about this and searching the forum for clues. I can't even start running down jogl-specific issues until I can compile.

I suspect this is some Netbeans setup issue I haven't had to worry about for a very long time.

Any ideas/suggestions/comments/solutions?

TIA

Reply | Threaded
Open this post in threaded view
|

Re: Ubuntu/Linux misc. problems: jogl, j3d, netbeans...

gouessej
Administrator
Hello

What do you mean by "J3D APR2015"? I advise you to read this:
http://forum.jogamp.org/JogAmp-s-Java3D-continuation-Java3D-1-6-0-and-later-td4030907.html

We don't maintain Java3D <= 1.5.

Moreover, there is (almost?) no problem with JOGL and GNU Linux. I have used JOGL with various GNU Linux distributions since 2006, it works like a charm. There is only one known bug with the latest versions of Mesa.

The problem is that your post is very inaccurate. You wrote "But, I get immediate errors" but which errors do you get? How can you expect to get some help by providing so few pieces of information about your concern?

Please strictly follow my instructions and it should work very well:
http://gouessej.wordpress.com/2012/08/01/java-3d-est-de-retour-java-3d-is-back/
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Ubuntu/Linux misc. problems: jogl, j3d, netbeans...

LordSmoke
This post was updated on .
Thanks, Julien, I am back at my desk now and working on this.

I had missed the Java3D upgrade as I had not had any problems with my old code - I have been working solely with JOGL GLSL for a few years now and not Java3D. I will check into that.

My post was very general because I think my problem is general Netbeans setup, and nothing JOGL-specific. The errors I was reporting are Netbeans errors flagging import lines with the error msg. "Package xxxxx does not exist."

I will check out the updated Java3D libs and see if that, as I expect, solves all or most of my problems.

Will report here the results.

Again, thanks!

UPDATE: FWIW, I can now compile in Ubuntu. At least I now see problems to investigate and more experiments to run before bothering the community. Thanks, again.
Reply | Threaded
Open this post in threaded view
|

Re: Ubuntu/Linux misc. problems: jogl, j3d, netbeans...

gouessej
Administrator
Thank you for your feedback. Let us know which problems are still there.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Ubuntu/Linux misc. problems: jogl, j3d, netbeans...

LordSmoke
UPDATE: Okay, I have had my first round of success using a recent jogamp-fat.jar (FEB 2018?) and the 2017 j3D jars provided by Julien.

All three of my test apps in their latest form (not the old downloaded versions) compile and run in Ubuntu with Oracle 8. The non-J3D ones also mostly run under OpenJDK. I won't post any error details until I have time to do some more research on my own.

Here are pics of two apps running in Ubuntu 18.04, Oracle Java 8 on a VirtualBox 6.0 under Mac OS X 10.14.2
Reply | Threaded
Open this post in threaded view
|

Re: Ubuntu/Linux misc. problems: jogl, j3d, netbeans...

LordSmoke
Apparently I can have only one image per reply, so here is the non-J3D graphics program running. There is a lot going on in this one...
Reply | Threaded
Open this post in threaded view
|

Re: Ubuntu/Linux misc. problems: jogl, j3d, netbeans...

LordSmoke
In reply to this post by LordSmoke
Haven't been able to work on this (jogl+j3d+ubuntu+oracle/openjdk) for a while due to class and must now give it a formal rest while I add some functionality to my programs - Windows and Mac work. However, I wanted to make another post to document some issues that might be useful to developers.

I had JOGL working on all platforms, but not J3D. I think I was making progress there, until...

====
NOTES: 20190220 – auto update of ubuntu (18.04.1) broke everything. Deleted and reinstalled all java versions, netbeans, and recopied my development directories.

Install of headless OpenJDK 8 caused crash of morpheus_eProbe (only checks jogl/j3d installs with some calls to see if they work, and they should) with:

java -jar ./morpheus_eProbe.jar
Exception in thread "main" java.awt.AWTError: Assistive Technology not found: org.GNOME.Accessibility.AtkWrapper
        at java.awt.Toolkit.loadAssistiveTechnologies(Toolkit.java:807)
        at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:886)
        at java.awt.Toolkit.getEventQueue(Toolkit.java:1736)
        at java.awt.EventQueue.invokeLater(EventQueue.java:1294)
        at morpheus_eprobe.Morpheus_eProbe_startup.main(Morpheus_eProbe_startup.java:51)

**** Removal of headless OpenJDK 8 and installation of full JDK fixed problem. Found this fix in general (not jogl-specific) online discussion.

====
After the above, my jogl test program works until I try to do the most basic jogl stuff - create a window and draw a white triangle. The error is...

java -jar ./morpheus_JOGL.jar
libEGL warning: DRI2: failed to authenticate
Exception in thread "AWT-EventQueue-0" com.jogamp.opengl.GLException: Profile GL3bc is not available on X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x7f401019f7f0, owner true, JAWTToolkitLock[obj 0x73229684, isOwner true, <5202498d, 31dce888>[count 1, qsz 0, owner <AWT-EventQueue-0>]]], but: [GLProfile[GLES1/GLES1.sw], GLProfile[GLES2/GLES3.sw], GLProfile[GL2ES1/GLES1.sw], GLProfile[GL4ES3/GLES3.sw], GLProfile[GL2ES2/GL3.sw], GLProfile[GL3/GL3.sw], GLProfile[GLES3/GLES3.sw], GLProfile[GL3/GL3.sw], GLProfile[GL2GL3/GL3.sw]]
        at com.jogamp.opengl.GLProfile.get(GLProfile.java:991)
        at jogamp.opengl.GLContextImpl.verifyInstance(GLContextImpl.java:1471)
        at jogamp.opengl.GLContextImpl.setGLFunctionAvailability(GLContextImpl.java:1942)
        at jogamp.opengl.x11.glx.X11GLXContext.createImpl(X11GLXContext.java:395)
        at jogamp.opengl.GLContextImpl.makeCurrentWithinLock(GLContextImpl.java:765)
        at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:648)
        at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:586)
        at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1279)
        at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1147)
        at com.jogamp.opengl.awt.GLCanvas$12.run(GLCanvas.java:1438)
        at com.jogamp.opengl.Threading.invoke(Threading.java:223)
        at com.jogamp.opengl.awt.GLCanvas.display(GLCanvas.java:505)
        at com.jogamp.opengl.awt.GLCanvas.paint(GLCanvas.java:559)
        at sun.awt.RepaintArea.paintComponent(RepaintArea.java:264)
        at sun.awt.X11.XRepaintArea.paintComponent(XRepaintArea.java:64)
        at sun.awt.RepaintArea.paint(RepaintArea.java:240)
        at sun.awt.X11.XComponentPeer.handleEvent(XComponentPeer.java:584)
        at java.awt.Component.dispatchEventImpl(Component.java:4965)
        at java.awt.Component.dispatchEvent(Component.java:4711)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
        at java.awt.EventQueue.access$500(EventQueue.java:97)
        at java.awt.EventQueue$3.run(EventQueue.java:709)
        at java.awt.EventQueue$3.run(EventQueue.java:703)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
        at java.awt.EventQueue$4.run(EventQueue.java:733)
        at java.awt.EventQueue$4.run(EventQueue.java:731)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

NOTE: I am not asking for help with any of the above. It will be a while before I can worry about this particular problem. Instead, I post it in case it is of use to the jogl/j3d developers.
Reply | Threaded
Open this post in threaded view
|

Re: Ubuntu/Linux misc. problems: jogl, j3d, netbeans...

gouessej
Administrator
Hello

Why do you mean by "full JDK"? Yes installing only the headless part of OpenJDK isn't enough.

Your second problem might be caused by a combination of a particular version of Mesa and your hardware. Let me know which graphics card you use and which version of Mesa you use with Ubuntu 18.04, I assume it's at least Mesa 18.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Ubuntu/Linux misc. problems: jogl, j3d, netbeans...

LordSmoke
gouessej wrote
Hello

Why do you mean by "full JDK"? Yes installing only the headless part of OpenJDK isn't enough.

Your second problem might be caused by a combination of a particular version of Mesa and your hardware. Let me know which graphics card you use and which version of Mesa you use with Ubuntu 18.04, I assume it's at least Mesa 18.
MacOS: 10.14.3
Virtualbox: 6.0
Ubuntu: 18.04.01

Playing the role of the naive user, if you try to run a java program in a "clean", "new" install of the above Ubuntu, you get the message:

java

Command 'java' not found, but can be installed with:

sudo apt install default-jre            
sudo apt install openjdk-11-jre-headless
sudo apt install openjdk-8-jre-headless

which directs the user to install the headless version. An end-user would not necessarily think it necessary to install the development kit (jdk) over just the headless runtime (jre) as instructed.

Installing the default gets you OpenJDK 10.0.2, but not sure if headless or jdk.
Reply | Threaded
Open this post in threaded view
|

Re: Ubuntu/Linux misc. problems: jogl, j3d, netbeans...

gouessej
Administrator
default-jre installs the default OpenJDK JRE, not only the headless JRE.
Julien Gouesse | Personal blog | Website