Announcement

Collapse
No announcement yet.

Java 11 and WorldWind

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Java 11 and WorldWind

    Has anyone attempted to build a WorldWind project using Java 9 or beyond? We have been developing with WorldWind for many years, but we're beginning to think about the upcoming changes with Java and how to proceed. We are currently developing with the latest Java 8 update (Java SE 1.8.0_181) and have not even downloaded a Java version beyond version 8.

    Just very curious if anyone has experimented with this or knows if it will even be possible to compile a WorldWind project with Java 11?

  • #2
    Hi, to not really answer your question, but as a side note...
    I use the WorldWind Java SDK (as external libraries) on my project which is compiled with Oracle Java 10 and there are some warning at runtime (in OpenGL code in gluegen-rt.jar) telling me that some code will fail soon...

    HTML Code:
    WARNING: An illegal reflective access operation has occurred
    WARNING: Illegal reflective access by com.jogamp.common.os.NativeLibrary$3 (file:/home/sbodmer/Sources/netbeans/JWorldWindEarth/lib/worldwind/gluegen-rt.jar) to method java.lang.ClassLoader.findLibrary(java.lang.String)
    WARNING: Please consider reporting this to the maintainers of com.jogamp.common.os.NativeLibrary$3
    WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
    WARNING: All illegal access operations will be denied in a future release

    Comment


    • #3
      sbodmer, thanks for the response! That is very interesting and helpful. Is that the only warning on Java 10 or are there others? I am suspicious that this warning will probably become a failure in Java 11 and that there will likely be quite a few others.

      I am waiting for Java 11 to be released before spending time digging into this. Hopefully that will happen later this month.

      Thanks again for the response!

      Comment


      • #4
        Curious if anyone else has experimented with WorldWind and Java 10 or an early release of Java 11?

        Comment


        • #5
          I am having a terrible, unsuccessful time getting WWJ working on Java 10/11 with Eclipse Photon. I am running into 2 types of problems:

          a) Can't get the MSVirtualEarth (= Bing Imagery? -- can't tell from the lack of documentation) to load consistently between almost identical machines (works on old Surface Pro 3 and not on newer Surface Pro) with the same Java and Eclipse loaded and identical code. The ApplicationTemplate demo can show the high resolution Bing Imagery on either machine just fine, so it doesn't seem to be a hardware issue but my own demo code uses the MSVirtualEarth layer which appears only to load on the older Surface and not the newer one. I can't find anywhere in the documentation how to load the Bing Imagery directly and ApplicationTemplate demo loads it completely opaquely using methods whose return values, i.e. what layers are returned, is completely undocumented and there are no class files that appear to represent the Bing Imagery layer in the source code, only a lone XML config file which I can't figure out how to use.

          b) Can't get a program to run without exceptions when using modules -- a variety of red herring exceptions, e.g. index out of bounds (-1) and class loading errors, when trying to load the layers. The exception depends on what layer's loading crashes, e.g. whether or not one loads the control panel layer where the exception appears to be related to being unable to read the up/down arrow image files via the layer class's Resources (working directory of resources is incorrect?).


          I have figured out that when using modules, that one has to treat the WWJ JAR files as "automatic modules" and put them on the module path rather than the class path and that the "Defines one or more modules" option must be checked in the "Is modular" property in order for one's project to compile and for the editor to be able to find the imports.

          The module-info.java file seems to need to contain at least:

          requires transitive worldwind;
          requires transitive worldwindx;
          requires transitive jogl.all;


          On the other hand, I am still unable to get any of the WWJ demos to work nor my code that has been running for years up to this point, so I may be either incorrect or incomplete in what I've found so far. Hopefully, this will give someone else some ideas on how to proceed.

          I've been pulling my hair out for days on this and my system has to be running on Java 10 in Eclipse Photon with modules by the end of the week, so any advice or suggestions would be greatly appreciated!

          Thank you in advance!

          Comment


          • #6
            Hello,
            I've also tried to run WorldWind under java 10 and had to run back to java version "1.8.0_144". The biggest problem was compatibility with the jogl implementation as i remember.
            i've been looking arround the forums to find alternative jars for jogl but i think its a dead proyect. it was last updated in 2015. I think theres a new proyect in java to interact with native code but its still under developement for java 12 o 13.
            Things are looking greem here. I'm seriously thinking on moving to the javscript version but i use a lot of the AnalythicSurfaceLayer and i think its not in the web version.
            For now im stiking to java 8 and waiting for a suitable solution to come.
            Cheers!

            Comment


            • #7
              I unfortunately don't have the option of falling back to Java 8. I agree that indications point towards JOGL as the issue. Note that the current 2.1.0 release of WWJ does not use the latest version of JOGL (2.3.2). See my conversation in the pull request for updating of WWJ to use JOGL 2.3.2. However, the pull request is only tested on Java 8, not Java 9+ with modules, so it is not clear the new JOGL will make any difference. I have not found any info on running JOGL on Java 9+ as yet either unfortunately.
              This pull request enable users to distribute and bundle WorldWind in combination with Oracle's Java SE builds by complying with the Java SE binary license section F. "F. JAVA TECHNOLOGY RESTRICTIONS. You may not create, modify, or change the behavior of, or authorize your licensees to create, modify, or change the behavior of, classes, interfaces, or subpackages that are in any way identified as "java", "javax", "sun", “oracle” or similar convention as specified by Oracle in any naming convention designation." http://www.oracle.com/technetwork/java/javase/terms/license/index.html JogAmp JOGL have relocated javax.media.opengl.* -> com.jogamp.opengl.* to relax probable license issue while bundling JOGL. For details see: https://jogamp.org/bugzilla/show_bug.cgi?id=682 This update was mostly done using find and replace across the source tree like this: git grep -lz 'javax.media.opengl' | xargs -0 perl -i'' -pE "s/javax.media.opengl/com.jogamp.opengl/g" git grep -lz 'javax.media.nativewindow' | xargs -0 perl -i'' -pE "s/javax.media.nativewindow/com.jogamp.nativewindow/g" I had to manually fix some minimal JogAmp JOGL 2.x.x -> 2.3.2 API changes I imported the JogAmp JOGL 2.3.2 jars using: wget http://jogamp.org/deployment/v2.3.2/archive/jogamp-all-platforms.7z 7z x jogamp-all-platforms.7z cp jogamp-all-platforms/jar/gluegen-rt.jar . cp jogamp-all-platforms/jar/gluegen-rt-natives-.jar . cp jogamp-all-platforms/jar/jogl-all.jar . cp jogamp-all-platforms/jar/jogl-all-natives-.jar .

              Comment


              • #8
                I have a theory (not entirely proven yet but strongly supported by my observations) that much of the problem in converting WWJ to be compatible with modular Java 9+ projects lies in the use of multiple JAR files in the WWJ and JOGL systems.

                When adding regular JAR files to the module path in Java 9+, the JAR files are treated as "automatic modules" which have relaxed but not entirely open access restrictions.

                For instance, in a project with modules, the ApplicationTemplate demo encounters problems trying to load the arrow images for the control panel map layer. Looking at the affected code, one sees that the LayerPanel is in the worldwindx JAR file but when it calls obj.class.getResource(file_location), the image file location is actually located in the worldwind JAR file. In a non-modular project, all JAR files are effectively unpacked into the same default package directory, so accessing resources between JAR files is not a problem because they are all logically connected to the same directory tree. However, in Java 9+'s modules, obj.class.getResource(file_location) is only allowed to access file locations that are within the same module. Cross-module resource access is not possible. Thus, in these environments, an exception is thrown when the image files are attempted to be loaded.

                Simply unpacking the worldwind.jar and worldwindx.jar files into a common directory structure makes the resource loading problem go away. So perhaps a solution is to simply merge the worldwind.jar and worldwindx.jar files.

                JOGL seems to have similar multi-JAR file problems, resulting in an inability, I think, to load the machine-dependent native code part of the JOGL system. Unfortunately, trying to convert WWJ to the latest JOGL 2.3.2 requires changing JOGL package names plus, most problematically, the disappearance of the GLU.destroy() method. For details, please see the discussion in the above linked "Pull Request #1" linked above.

                Right now, my biggest stumbling block is how to replace the GLU.destroy() call in
                DebugListener.dispose()
                If I can fix this issue, I should be able to make a testable WWJ+JOGL system.

                Any suggestions, feedback, advice, comments, etc.?

                Thanks in advance!

                Comment

                Working...
                X