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

Java Plugin versions adjustment #3331

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alex-fusionauth
Copy link
Contributor

No description provided.

@alex-fusionauth alex-fusionauth requested review from a team as code owners October 11, 2024 14:59

- https://www.oracle.com/java/technologies/javase-downloads.html

<Aside type="note">
For plugins the Java version must be 21 or lower. That is a hard requirement since the byte code for 23 will not run in 21.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the version that can be used is tied to the version of FusionAuth. The release notes list the version of java supported by different FusionAuth versions but you kinda have to hunt (1.32.0 was the first one to support Java 17, and 1.53.0 was the first to support java 21.) The behavior if you use a later version of Java to build a plugin than is supported by that version of FusionAuth is undefined but I can't imagine it'd be good. We'd need to test.

That limitation is not clearly outlined here. Can you please document that?

Copy link
Member

@robotdan robotdan Oct 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know that I like how this is written.

In practice, you can build with Java 21, 23, etc., as long as you build for a target of Java 8, 17 or 21.

To Dan's point, I don't think it will be obvious which version of Java they are using at runtime in FusionAuth, and that is somewhat intentional. This is mostly an internal detail.

However, it does matter here. So I think the simplest way to document this is to say something like:

Plugins should be built with a target of Java 8. If you wish to use Java features that would require Java 17, or 21, review the following table to identify what versions allow a plugin to be compiled for later versions.

From reading release notes, I think the following is true for Java support:

  • Java 8 - < 1.32.0
  • Java 17 - >= 1.32.0 AND < 1.53.0
  • Java 21 - >= 1.53.0

If we make updates to -site, we should make that same update in the example repo ideally since that is the source code we provide to bootstrap building a plugin.


To provide maximum compatibility we recommend using Java at version 8.

In a spec file this would be represented as `min java version is 8, max is 21`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what a spec file is and don't see it mentioned elsewhere on this page. What is it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. I don't know what this means. Setting the source and target version f Java will depend upon your build tool.
If we want to document this, we should use our example repo as a guide, this uses maven.

See the following

 <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>

found here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants