Skip to content

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:

@alex-fusionauth
Copy link
Contributor Author

@mooreds do we need this PR?

@mooreds
Copy link
Contributor

mooreds commented Apr 14, 2025

I'd still like to see these two things documented:

  • you can't build a plugin with a later version of Java than that which your FusionAuth instance is running in
  • how a user can find out which version of Java FusionAuth is running (look at the release notes)

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