Posted by
neblaz on
Sep 05, 2021; 3:47pm
URL: https://forum.jogamp.org/JOGL-2-3-2-example-compiles-but-fails-to-run-Maven-3-8-2-NetBeans-12-4-OpenJDK-16-0-2-Lubuntu-21-10-tp4041246.html
I want to start learning OpenGL with JOGL, tried but cannot run any example so far.
To not repeat myself in whole details, I created a post a Stack Overflow already:
https://stackoverflow.com/questions/69058541/jogl-2-3-2-example-compiles-but-fails-to-run-maven-in-netbeans-12-4According to an answer there I switch for future questions to this official forum.
I followed the answer given at Stack Overflow, created a new Java with Maven project in NetBeans 12.4, and created the mentioned example RawGL2ES2demo.java, also added just the two dependencies to the pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="
http://maven.apache.org/POM/4.0.0" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>JOGLsecond</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.jogamp.gluegen</groupId>
<artifactId>gluegen-rt-main</artifactId>
<version>2.3.2</version>
</dependency>
<dependency>
<groupId>org.jogamp.jogl</groupId>
<artifactId>jogl-all-main</artifactId>
<version>2.3.2</version>
</dependency>
</dependencies>
</project>
The project compiles (Clean and Build), but when I do Run File on the RawGL2ES2demo.java I get the following error:
cd /home/me/NetBeansProjects/JOGLsecond; JAVA_HOME=/home/me/PROGRAMs/openjdk-16.0.2 M2_HOME=/home/me/PROGRAMs/apache-maven-3.8.2 /home/me/PROGRAMs/apache-maven-3.8.2/bin/mvn -Dexec.vmArgs= "-Dexec.args=${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}" -Dexec.executable=/home/me/PROGRAMs/openjdk-16.0.2/bin/java -Dexec.mainClass=com.mycompany.joglsecond.RawGL2ES2demo -Dexec.classpathScope=runtime -DskipTests=true -Dexec.appArgs= org.codehaus.mojo:exec-maven-plugin:3.0.0:exec
Running NetBeans Compile On Save execution. Phase execution is skipped and output directories of dependency projects (with Compile on Save turned on) will be used instead of their jar artifacts.
Scanning for projects...
----------------------< com.mycompany:JOGLsecond >----------------------
Building JOGLsecond 1.0-SNAPSHOT
--------------------------------[ jar ]---------------------------------
--- exec-maven-plugin:3.0.0:exec (default-cli) @ JOGLsecond ---
Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/jogamp_0000/file_cache/jln6197218351352021716/jln3368270845480343845/natives/linux-amd64/libnativewindow_awt.so: /home/me/PROGRAMs/openjdk-16.0.2/lib/libjawt.so: version `SUNWprivate_1.1' not found (required by /tmp/jogamp_0000/file_cache/jln6197218351352021716/jln3368270845480343845/natives/linux-amd64/libnativewindow_awt.so)
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:383)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:227)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:169)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2383)
at java.base/java.lang.Runtime.load0(Runtime.java:746)
at java.base/java.lang.System.load(System.java:1857)
at com.jogamp.common.jvm.JNILibLoaderBase.loadLibraryInternal(JNILibLoaderBase.java:603)
at com.jogamp.common.jvm.JNILibLoaderBase.access$000(JNILibLoaderBase.java:63)
at com.jogamp.common.jvm.JNILibLoaderBase$DefaultAction.loadLibrary(JNILibLoaderBase.java:106)
at com.jogamp.common.jvm.JNILibLoaderBase.loadLibrary(JNILibLoaderBase.java:487)
at jogamp.nativewindow.NWJNILibLoader.access$000(NWJNILibLoader.java:39)
at jogamp.nativewindow.NWJNILibLoader$1.run(NWJNILibLoader.java:49)
at jogamp.nativewindow.NWJNILibLoader$1.run(NWJNILibLoader.java:41)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
at jogamp.nativewindow.NWJNILibLoader.loadNativeWindow(NWJNILibLoader.java:41)
at jogamp.nativewindow.jawt.JAWTUtil.<clinit>(JAWTUtil.java:336)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:466)
at com.jogamp.nativewindow.NativeWindowFactory$3.run(NativeWindowFactory.java:344)
at com.jogamp.nativewindow.NativeWindowFactory$3.run(NativeWindowFactory.java:340)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
at com.jogamp.nativewindow.NativeWindowFactory.initSingleton(NativeWindowFactory.java:340)
at com.jogamp.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1721)
at com.jogamp.opengl.GLProfile.access$000(GLProfile.java:80)
at com.jogamp.opengl.GLProfile$1.run(GLProfile.java:230)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
at com.jogamp.opengl.GLProfile.initSingleton(GLProfile.java:216)
at com.jogamp.opengl.GLProfile.getProfileMap(GLProfile.java:2297)
at com.jogamp.opengl.GLProfile.get(GLProfile.java:988)
at com.jogamp.opengl.GLProfile.get(GLProfile.java:1004)
at com.mycompany.joglsecond.RawGL2ES2demo.main(RawGL2ES2demo.java:248)
Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:404)
at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:166)
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:982)
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:929)
at org.codehaus.mojo.exec.ExecMojo.execute (ExecMojo.java:457)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:78)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:567)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 1.912 s
Finished at: 2021-09-05T17:28:59+02:00
------------------------------------------------------------------------
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (default-cli) on project JOGLsecond: Command execution failed.: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionExceptionI see in the import that GL2ES2 is used, OK I'm new to OpenGL and JOGL, but I know that GL4ES3 is available for import. Trying this gives the same error.
I assume that this example is quite old, as I can see in the error message:
libnativewindow_awt.so
Why is nowerdays still AWT in use?