NASAWorldWind / WorldWindJava

The NASA WorldWind Java SDK (WWJ) is for building cross-platform 3D geospatial desktop applications in Java.
719 stars 327 forks source link

Java 8 compatible 2.2.0 #210

Open mattbru2 opened 4 years ago

mattbru2 commented 4 years ago

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).

FJBDev commented 4 years ago

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."

markpet49 commented 4 years ago

@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.

pos430 commented 4 years ago

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.

jondiehl commented 4 years ago

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!

mattbru2 commented 4 years ago

@markpet49 Any official information or updates?

m11a-code commented 4 years ago

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.

markpet49 commented 4 years ago

@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?

m11a-code commented 4 years ago

@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.

FJBDev commented 4 years ago

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

Not very important for us

mckelvym-usgs commented 4 years ago

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

mainstringargs commented 3 years ago

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

FJBDev commented 3 years ago

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 ?

mainstringargs commented 3 years ago

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

On Thu, Nov 12, 2020 at 5:47 PM FJBDev notifications@github.com 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 .

wcmatthysen commented 3 years ago

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.