Skip to content
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

Intellij 2024.2: Investigation of Changes Needed to Support Java 21 #1019

Closed
vaisakhkannan opened this issue Oct 15, 2024 · 7 comments
Closed
Assignees

Comments

@vaisakhkannan
Copy link
Contributor

As part of supporting IntelliJ 2024.2, we need to support Java version 21. During the investigation, we found that our development environment should also run on the Java 21 SDK. Therefore, we need to update the Java version to 21 for the sample projects used in test automation.

@staicy123
Copy link

staicy123 commented Oct 16, 2024

Hi @TrevCraw, this is where we found that the source compatibility for intellij version 2024.2 should be 21.
Screenshot 2024-10-16 at 11 22 32 AM

staicymathew@staicys-mbp liberty-tools-intellij2 % ./gradlew buildPlugin

Task :patchPluginXml
[org.jetbrains.intellij.platform] Patching plugin.xml: attribute 'since-build=[241]' of 'idea-version' tag will be set to '242.20224'
[org.jetbrains.intellij.platform] Patching plugin.xml: attribute 'until-build=[241.]' of 'idea-version' tag will be set to '242.'

Task :verifyPluginProjectConfiguration
[org.jetbrains.intellij.platform] The following plugin configuration issues were found:

  • The IntelliJ Platform cache directory should be excluded from the version control system. Add the '.intellijPlatform' entry to the '.gitignore' file.
  • The Java configuration specifies sourceCompatibility='17' but IntelliJ Platform '2024.2.0.1' requires sourceCompatibility='21'.

https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html#platformVersions
Screenshot 2024-10-16 at 4 09 51 PM

@TrevCraw
Copy link
Contributor

TrevCraw commented Oct 16, 2024

Regarding Java versions, as long as we are not using Java 21 features, we may be able to build against Java 21 and run on Java 17. Or, if that is not best practice, it may be possible to build with Java 17 and run on Java 21. I will defer to @mrglavas for the best way to achieve multiple levels of JVM support.

Regardless of the strategy, we will need to test it out. We should be able to find a way to support both 2024.1 and 2024.2. According to the JetBrains marketplace, Quarkus Tools supports both 2024.1 and 2024.2 - https://plugins.jetbrains.com/plugin/13234-quarkus-tools/versions. I do not see Quarkus Tools using Java 21 in their build file - https://github.com/redhat-developer/intellij-quarkus/blob/main/build.gradle.kts#L133-L139. I would recommend trying out Quarkus Tools on 2024.2.

Maybe you can find other example plugins that support 2024.1 and 2024.2 and see how they do it?

@TrevCraw
Copy link
Contributor

Hi @mrglavas , I am not sure of the best practice regarding supporting multiple Java versions with one build, but I am wondering if it is even achievable based on how the IntelliJ ecosystem is set up.

@TrevCraw
Copy link
Contributor

Hi @staicy123, @vaisakhkannan, after a discussion with @mrglavas and @turkeylurkey, it is recommended that we do not build with Java 21 and run on Java 17, as there are potential negative side effects. It should be safe, however, to build with Java 17 and run on Java 21. In order to do that, we need to do a few things:

  • Our production build would need to be targeted to Java 17 and IntelliJ 2024.1.
  • Confirm that a plugin built with Java 17 and IntelliJ 2024.1 can run on IntelliJ 2024.2.
  • Development work needs to be completed using Java 21 and IntelliJ 2024.2 to find any issues and deal with any methods that may have been removed between 2024.1 and 2024.2.
  • Reach out to JetBrains to inform them of how we plan to support 2024.1 and 2024.2 to see if our strategy is reasonable and ask if there is a better or recommended way to support both 2024.1 and 2024.2.

@staicy123
Copy link

Hi @TrevCraw, please find the discussion with jetbrains team regarding using java 17 here https://jetbrains-platform.slack.com/archives/C5U8BM1MK/p1729162829013169

@vaisakhkannan
Copy link
Contributor Author

vaisakhkannan commented Oct 18, 2024

Hi @TrevCraw, I checked the Quarkus Tools plugin code, cloned it, and ran the extension and UI tests. I found that both the extension IDE and UI test IDE are running on IntelliJ version 2023.2, but they also support IntelliJ 2024.2. I was able to install the Quarkus Tools plugin in IntelliJ 2024.2.

The reason they did not specify the untilBuild is that it indicates support for every latest release. They may be testing the plugin using EAP IntelliJ versions.

@staicy123 staicy123 moved this from New Issues to In Review in Open Liberty Developer Experience Oct 30, 2024
@staicy123
Copy link

Our intention is to support both IntelliJ 2024.1 and 2024.2, so we have decided to set the common Java version to 17. However, we have also verified that we can support Java version 21 in IntelliJ 2024.2. Therefore, we will be closing this issue.

@github-project-automation github-project-automation bot moved this from In Review to Sprint Closed in Open Liberty Developer Experience Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

3 participants