-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for JDK 11 #755
Comments
@JoelProminic Can you run I actually tested with AdoptOpenJDK 11 on macOS too, so I'm curious if you ended up with a different build that reports a differently formatted version number. |
Guys the only dependency on Java 8 which we have is Payara which we are using to Preview PrimeFaces Visual Editor stuff in the browser. I just did an upgrade, cause they claim on some blog that support for Java 11 has been added. It's working perfectly. In my opinion we can switch in SDK Installer to Java 11. |
@joshtynjala, here is the full version information for the AdoptOpenJDK build I am using. I am iusing the Hotspot JVM instead of OpenJ9.
I tried this again, and I still see this error for each Java project:
|
Thank you! That's exactly what I needed. I looks like the version number can optionally have four parts (like 11.0.9.1), which contradicts Oracle's Java documentation. I just found another document, specifically for OpenJDK, where I see that they allow four or more version parts. I'll update my version checking code to take that into account. |
@JoelProminic I've updated the Java version number parsing. Does that work for you? |
I can run Java Maven and Gradle projects now. For future reference, I got this error for an old Java Gradle project:
After some investigation, I found that the Gradle daemon was running with Java 15 for this project, and the eclipse configuration files had references to Java 15. I must have created this project when testing OpenJDK 15. I resolved this by running the TODO on this issue:
|
@joshtynjala whenever I open Flex Air Desktop App - I'm getting following error:
I'm using Open JDK 11 |
…n string is found (references #755)
@piotrzarzycki21 I can see where there might be a null exception. My latest commit should fix that. |
@joshtynjala It helped to see something different than previous information. I see now, when I open Adobe Air Flex project
|
Oh wow, so there might not even be a minor version! |
Yeah! It looks like openjdk provides it's version without minor ;) If you can fix that quickly would be good - if not I will get back to previous version of Moonshine, cause right now code intelligence won't work, unless I change java ;) |
@piotrzarzycki21 My latest commit should allow the minor part of the version to be optional! |
It's working now Josh! Thank you! |
If we finalize with AdoptOpenJDK11, based on the existing download URLs, this location we can use for pointing a download build - https://github.com/AdoptOpenJDK/openjdk11-binaries/releases. |
One of the possible idea to do not run into an issue where JDK 8 is needed would be have two entries (JDK 8 and 11) in Moonshine SDK Installer. |
It would also leads to split settings into two entry: JDK main one and JDK for Language Server. |
From a user perspective, this would create confusion. Moreover, if I would be that user, it'd be annoying (and doubtful) for me to install multiple JDKs even if provided through the MSDKI. |
I need to revisit my project that requires JDK 8 to see if I can make it work with Java 11. If I still have problems, I'll write up the use case for this issue so that we can discuss our options for supporting older projects. |
Unfortunately, the link contains all the pre-release entries, and I don't see any zip/tar.gz version of complete binary distribution as we can found for OpenJDK 8. |
Yes, as I understand it, setting the source/target values in pom.xml/build.gradle should change which JDK class paths are used by the language server. The most obvious place to test the language server changes, where you should see a difference in Moonshine after you change the source/target compatibility values and the JDK paths, is probably by which errors/warnings appear in the Problems view. The error messages that you quoted appear to come from the console output of build commands. The language server does not handle building projects, and I have not changed the build process to use JDK 8. I was assuming that @rat-moonshine was working on that part, but I can look into it if, you think I'd be best suited for that task. For Java builds, I think Moonshine runs either gradle or mvn in a shell, depending on the Java project type. I don't actually know how to tell gradle or mvn to use a specific JDK. Maybe by changing the JAVA_HOME environment variable to a different value? |
Yeah, changing JAVA_HOME will control which JDK Maven or Gradle use. This is already implemented in @rat-moonshine's changes. I expected that this would also need to be changed for the language server environment, but maybe I am misunderstanding your solution. |
Wait... isn't that the expected behavior? Why are you trying to build them with JDK 11? These Domino API projects need to be built with JDK 8, right? I downloaded 2021_03_26__TestJavaMaven_Domino.zip and imported it into Moonshine running from the features/issue_38_jdk11 branch. On my machine, when I set the JDK type to 8, it is successfully building with Ctrl+B (to be clear, I should mention again that this build command has nothing to do with the language server). The build fails with the Default JDK (11 on my machine) selected, which is what I would expect. Additionally, I see errors in the problems view as reported by the language server when I first open the project. That's expected, and after I add |
Yes, I expected the build to fail with JDK 11 even with those compliance settings. I was expecting the language server to get similar errors, but maybe that will not be a problem unless I try to use the classes with a dependency on CORBA. It is a good sign if the compliance settings clear all the Problems with my test projects - I expected an error for at least NotesException. I did a quick test with JDK 8 and the compliance settings and confirmed that they did not interfere with my normal build. Some options to set the compliance options for Java Maven/Gradle projects:
|
As we have The modified event should use |
For build plugins, including Gradle and Grails, I only ensured that correct JAVA_PATH is set (during a build) by temp-environment-util based on the project's own settings. Glimpse of those changes are at here: 352bcda. |
@rat-moonshine Yes, either restoring the event or creating a new event would be fine. |
Okay. I have restored by the same event with Java.8 path information. Please, check. |
Alright, then. Language server changes seem to be good to go. |
I tried the new build. I found that it worked well for the example *_Domino projects I attached above, as long as I added the compatibility lines. However, when I test with my "real" projects, I'm getting errors like this on the console when the language server starts:
I can't share this project since it has some Prominic-specific information. I don't see anything special about the GroupDocIdentifier class, so I think this might be one of many errors in the current state. I'll investigate this further and let you know if I can reproduce this error with a smaller project. |
@JoelProminic If you won't have time to look into that more I would like to ask @rat-moonshine for merge these branch along with branch from SDK Installer. I will use stuff daily and see what is happening. |
Yes, I'm fine with merging this branch. It seems to be working for this project at least. I don't think anyone besides me is doing practical work with Java in Moonshine, but it will be good to confirm it isn't breaking anything for other projects. |
Both the Moonshine and Moonshine-SDK-Installer JDK.11 branch now merged into 'master'. |
@rat-moonshine I see that Moonshine build correctly on Bamboo, but Nightly of SDK Installer is probably failing - could you check that ? |
Okay, i will. |
I see when I re-run the build, it completed successfully. I'm not sure why the macOS build failed earlier with plist error. |
I just tried SDK installer and was able to install Java 11 without the problem. I see it has been setup in Moonshine as well. |
I see some remaining errors for OpenJDK 8 in the Moonshine settings:
|
This be fixed now. Please check. |
I'm closing this issue. We have been tested this for several weeks now. |
@joshtynjala added some logic for #742 to require JDK 11+ for the language server on Java Projects. However, SDK Installer is currently installing JDK 8, and I am not sure if all of the other projects will support JDK.
I think we want to avoid bundling the Oracle JDK 11 installation with Moonshine, because it does require a license for commercial applications. We could use either Open JDK or AdoptOpenJDK instead.
I did some quick tests and I see that the Java Maven and Gradle projects on macOS report this error when opening with AdoptOpenJDK 11.
@piotrzarzycki21 reported that the Payara server we use for Primefaces Visual Editor projects has a dependency on Java 8, though this may be fixed now:
We need to do some more testing and investigation to confirm what we would need to do to support JDK 11 (or higher) as the default JDK for Moonshine.
The text was updated successfully, but these errors were encountered: