WorldWindJava icon indicating copy to clipboard operation
WorldWindJava copied to clipboard

Java 8 compatible 2.2.0

Open mattbru2 opened this issue 4 years ago • 14 comments

Is there any chance of putting together a Java 8 compatible version of the 2.2.0 release?

We cannot use Java 11 and have issues with JOGL on our Macs.

It looked like the main things in the code not compatible with Java 8 were a few instances of the usage of 'var' (easily fixed) and using Class.getPackage (replace with Package.getPackage?). I would prefer to use an "official" version rather than modifying the code myself, though I have tested it with these two changes and it appears to work.

Even just an initial official release of 2.2.0 with Java 8 compatibility due to the JOGL issues would be helpful (I understand maintaining two separate versions indefinitely would not be feasible).

mattbru2 avatar Aug 21 '20 18:08 mattbru2

I second @mattbru2 .

Our application is not "Java 11- ready" yet so we can't update to WWJ 2.2.0.

Based on the 2.2.0 release notes, I would also appreciate a Java 8 version of WWJ 2.2.0. Thanks!

"The prior release of WorldWind Java, v2.1.0, was compiled with Java 8. The decision was made to upgrade WWJ to Java 11 based on questionable support options for Java 8 at the time. This situation has evolved over time and we are evaluating whether a Java 8 version of WWJ is desirable. Your feedback is welcome."

FJBDev avatar Aug 24 '20 21:08 FJBDev

@mattbru2 @FJBDev Hi, Thanks for the feedback. We've seen a few requests for Java 8 support and have been discussing it internally. I'll reply in this thread when we have a definite answer.

markpet49 avatar Aug 24 '20 21:08 markpet49

I'll jump in on supporting this as well - would love to have an official release that supports Java 8, the fixes are such a timesaver in our application but currently that requires a custom build for our version of Java, as the initial comment suggests.

pos430 avatar Aug 24 '20 21:08 pos430

I'll add on here as well with my support for this! An official release with these fixes would be a huge help to my team! We've been painstakingly working around this very issue for 2 years! Many thanks!

jondiehl avatar Aug 25 '20 00:08 jondiehl

@markpet49 Any official information or updates?

mattbru2 avatar Oct 01 '20 17:10 mattbru2

Adding my request of a java 8 version of WWJ. Our application is currently not java 11 ready, so we are unable to use WWJ 2.2.0, but are looking forward to the latest. Also totally understand, like the initial poster mentioned, that maintaining two versions indefinitely wouldn't be reasonable, but even just having it for this one release would be awesome.

m11a-code avatar Oct 02 '20 17:10 m11a-code

@pengii23 @FJBDev @mattbru2 No status yet, but we've gotten a number of requests for Java 8 support from various WorldWind users, so I think pressure is building. The fly in the soup is that NASA is discouraging Java 8 usage, but there are ways to get an exception approved. There is a meeting on this coming Thursday where this will be discussed. Stay tuned.

Allow me to ask a question in return. How important would WorldWind Maven support be to you?

markpet49 avatar Oct 03 '20 03:10 markpet49

@markpet49 Thank you so much for the status update! While it would be best that we got ourselves updated to Java 11, we just don't see it happening for a while for our project, so hopefully things work out next Thursday!

To answer your question, while maven support for WorldWind would make things easier, it's not a requirement as we have a local nexus as well, so we could just upload the Java 8 WWJ 2.2.0 there for our use.

m11a-code avatar Oct 03 '20 03:10 m11a-code

Allow me to ask a question in return. How important would WorldWind Maven support be to you?

Not very important for us

FJBDev avatar Oct 03 '20 03:10 FJBDev

Would love to have maven support. Currently in progress of updating to Java 11.

mckelvym-usgs avatar Oct 05 '20 12:10 mckelvym-usgs

If anyone still needs this, I made a fork with the Java 8 changes here: https://github.com/mainstringargs/WorldWindJava-Java8

mainstringargs avatar Nov 12 '20 21:11 mainstringargs

If anyone still needs this, I made a fork with the Java 8 changes here: https://github.com/mainstringargs/WorldWindJava-Java8

Is it possible to have access to a jar file ? or does one need to build its own ?

FJBDev avatar Nov 12 '20 23:11 FJBDev

See here: https://github.com/mainstringargs/WorldWindJava-Java8/releases/tag/v2.2.0-Java8

On Thu, Nov 12, 2020 at 5:47 PM FJBDev [email protected] wrote:

If anyone still needs this, I made a fork with the Java 8 changes here: https://github.com/mainstringargs/WorldWindJava-Java8

Is it possible to have access to a jar file ? or does one need to build its own ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/NASAWorldWind/WorldWindJava/issues/210#issuecomment-726411300, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABVXM4QZI76TTQ6MZ5JTFD3SPRX2ZANCNFSM4QHQ3VPQ .

mainstringargs avatar Nov 12 '20 23:11 mainstringargs

This issue is pretty dumb, to be frank. @mattbru2, @FJBDev, @pos430, @jondiehl, @pengii23: you can literally just check out the code-base, open it with Netbeans and switch the compiler back to Java 8. You'll get a couple of errors where it complains about these lines:

var attrs = new BasicShapeAttributes();

Just change them back to:

BasicShapeAttributes attrs = new BasicShapeAttributes();

And you'll also see these lines giving errors:

p = classLoader.getDefinedPackage(pkgName);

Just change them to:

p = Package.getPackage(pkgName);

Also, change these:

Toolkit.getDefaultToolkit().getMenuShortcutKeyMaskEx()));

back to:

Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));

And, hey presto!, you end up with a code-base that compiles and runs both in Java 8 and Java 11. If only the developers of this project had the foresight to not make unnecessary changes to force the code base to only be compatible with Java 11 then this would never have been an issue. Also, why is this issue taking so long to resolve?

Oh, and @mckelvym-usgs, you can have a look at my enhancements branch. You'll see that I build the project with Gradle there. It's not Maven, but you can pretty much do everything that Maven does with Gradle (and some more). You'll just have to remove the nbproject folder to get this to work.

wcmatthysen avatar Jan 30 '21 23:01 wcmatthysen