<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://jogamp.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.2"
          urlbase="https://jogamp.org/bugzilla/"
          
          maintainer="sgothel@jausoft.com"
>

    <bug>
          <bug_id>810</bug_id>
          
          <creation_ts>2013-08-06 10:57:34 +0200</creation_ts>
          <short_desc>JOGL should only try to load the native libraries supported by the operating system</short_desc>
          <delta_ts>2013-09-02 21:04:11 +0200</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>JogAmp</classification>
          <product>Jogl</product>
          <component>core</component>
          <version>2</version>
          <rep_platform>All</rep_platform>
          <op_sys>all</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>---</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Julien Gouesse">gouessej</reporter>
          <assigned_to name="Julien Gouesse">gouessej</assigned_to>
          <cc>gouessej</cc>
    
    <cc>sgothel</cc>
          
          <cf_type>---</cf_type>
          <cf_scm_refs>gluegen c0ead6fa10280f8076704726d59f482b183fd77e
jogl 14eab8af439e6e7ce7ee08a9ca13fec3f3a80d25</cf_scm_refs>
          <cf_workaround>---</cf_workaround>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2871</commentid>
    <comment_count>0</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2013-08-06 10:57:34 +0200</bug_when>
    <thetext>When jogl-all-android.jar is in the classpath, JOGL tries to look for jogl-all-android-natives-macosx-universal.jar under OSX for example. This bug can be reproduced under GNU Linux too. The problem is that the error isn&apos;t very explicit:

Catched FileNotFoundException: /Library/Java/Extensions/gluegen-rt-android-natives-macosx-universal.jar (No such file or directory), while TempJarCache.bootstrapNativeLib() of jar:file:/Library/Java/Extensions/gluegen-rt-android-natives-macosx-universal.jar!/ (file:/Library/Java/Extensions/ + gluegen-rt-android-natives-macosx-universal.jar)
Catched FileNotFoundException: /Library/Java/Extensions/jogl-all-android-natives-macosx-universal.jar (No such file or directory), while addNativeJarLibsImpl(classFromJavaJar class jogamp.nativewindow.NWJNILibLoader, classJarURI jar:file:/Library/Java/Extensions/jogl-all-android.jar!/jogamp/nativewindow/NWJNILibLoader.class, nativeJarBaseName jogl-all-android): jogl-all-android-natives-macosx-universal.jar + file:/Library/Java/Extensions/ -&gt; jar:file:/Library/Java/Extensions/jogl-all-android-natives-macosx-universal.jar!/
Catched IOException: TempJarCache: addNativeLibs: jar:file:/Library/Java/Extensions/jogl-all-android-natives-macosx-universal.jar!/, previous load attempt failed, while addNativeJarLibsImpl(classFromJavaJar class jogamp.nativewindow.NWJNILibLoader, classJarURI jar:file:/Library/Java/Extensions/jogl-all-android.jar!/jogamp/nativewindow/NWJNILibLoader.class, nativeJarBaseName jogl-all-android): jogl-all-android-natives-macosx-universal.jar + file:/Library/Java/Extensions/ -&gt; jar:file:/Library/Java/Extensions/jogl-all-android-natives-macosx-universal.jar!/
Catched IOException: TempJarCache: addNativeLibs: jar:file:/Library/Java/Extensions/jogl-all-android-natives-macosx-universal.jar!/, previous load attempt failed, while addNativeJarLibsImpl(classFromJavaJar class jogamp.nativewindow.NWJNILibLoader, classJarURI jar:file:/Library/Java/Extensions/jogl-all-android.jar!/jogamp/nativewindow/NWJNILibLoader.class, nativeJarBaseName jogl-all-android): jogl-all-android-natives-macosx-universal.jar + file:/Library/Java/Extensions/ -&gt; jar:file:/Library/Java/Extensions/jogl-all-android-natives-macosx-universal.jar!/
Exception in thread &quot;main&quot; javax.media.opengl.GLException: No default device available
        at javax.media.opengl.GLProfile.getProfileMap(GLProfile.java:2011)
        at javax.media.opengl.GLProfile.get(GLProfile.java:863)
        at javax.media.opengl.GLProfile.getDefault(GLProfile.java:597)
        at javax.media.opengl.awt.GLCanvas.&lt;init&gt;(GLCanvas.java:247)
        at javax.media.opengl.awt.GLCanvas.&lt;init&gt;(GLCanvas.java:197)
        at javax.media.opengl.awt.GLCanvas.&lt;init&gt;(GLCanvas.java:187)
        at joglquad.JOGLQuad.main(JOGLQuad.java:78) 


GlueGen seems to look for only the Android native libraries when jogl-all-android.jar and jogl-all.jar are both in the classpath. Several people already made the same mistake. Shouldn&apos;t GlueGen skip Android native libraries at runtime when the operating system is another one?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2872</commentid>
    <comment_count>1</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2013-08-06 11:18:51 +0200</bug_when>
    <thetext>Shouldn&apos;t we add &quot;-android&quot; here?
https://github.com/sgothel/jogl/blob/master/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java#L49</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2873</commentid>
    <comment_count>2</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2013-08-06 13:14:45 +0200</bug_when>
    <thetext>I have to modify these lines too:
https://github.com/sgothel/jogl/blob/master/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java#L62

https://github.com/sgothel/jogl/blob/master/src/jogl/classes/javax/media/opengl/GLProfile.java#L155

It would be nice if someone could test with Android:
http://forum.jogamp.org/Recreating-Jogl2-Android-demo-projects-in-Eclipse-td4027079.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2876</commentid>
    <comment_count>3</comment_count>
    <who name="Julien Gouesse">gouessej</who>
    <bug_when>2013-08-07 11:36:08 +0200</bug_when>
    <thetext>First attempt of fix:
https://github.com/gouessej/jogl/commit/617aa7ad3e39e1adaac6d099b4d23fee52cfed0c</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2935</commentid>
    <comment_count>4</comment_count>
    <who name="Sven Gothel">sgothel</who>
    <bug_when>2013-09-02 21:04:11 +0200</bug_when>
    <thetext>Thank you Julien!

I took the freedom and moved the new method to 
GlueGen&apos;s JNILibLoaderBase class to solve JOGL&apos;s module dependency.
Better API doc added as well, my old one was .. errr .. not so clear.
Referencing you in commit log.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>