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

Building with Java 21 doesn't work #261

Open
GogleSiteBank opened this issue Mar 9, 2024 · 4 comments
Open

Building with Java 21 doesn't work #261

GogleSiteBank opened this issue Mar 9, 2024 · 4 comments
Assignees
Labels

Comments

@GogleSiteBank
Copy link

replicate:
run gradlew, unsupported version

@rbluer rbluer self-assigned this Apr 21, 2024
@rbluer rbluer added Invalid Unsupported An action was taken by the user which resulted in a result that is not supported. labels Apr 21, 2024
@rbluer
Copy link
Collaborator

rbluer commented Apr 21, 2024

This is not an issue of concern.

Prison is built to be backwards compatible with spigot 1.8.x and also support the latest spigot release 1.20.x and newer.

Therefore, prison is intended to be built with Java 1.8 to ensure that compatibility with spigot 1.8.x. Newer versions of Java are not supported since the backwards compatibility is a higher priority.

Jars that are generated with Java 1.8.x are always compatible with newer releases of java, such as Java 21.

Therefore, this is not an issue and it is not a bug.

@rbluer rbluer closed this as completed Apr 21, 2024
@rbluer
Copy link
Collaborator

rbluer commented Apr 28, 2024

I'm sorry... are you a real person? From your name, it sounded like you were an automated bot?

If you are a person, I think I better understand your concerns.

Overall, prison is built with java 1.8, and must continue to do so.

But I'll have to take a look at gradle to see what the options are for running gradle's latest release, but the result must still be compatible with Java 1.8.

@rbluer rbluer reopened this Apr 28, 2024
@rbluer rbluer removed Invalid Unsupported An action was taken by the user which resulted in a result that is not supported. labels Apr 29, 2024
@rbluer
Copy link
Collaborator

rbluer commented Apr 29, 2024

I'm removed the tags 'invalid' and 'unsupported' from this issue.

The concern that I'm seeing with trying to build with java 17, which presents the same issues with using java 21, would be that the gradle configs are set for Java 8.

I'm going to explore using gradle's newer libs.versions.toml file support, which can set global versions for all sub-projects. This allows the changing of the versions in one location, instead of updating all sub-module settings. This won't solve the problem with Java 17 and 21 support, but I'm planning on performing the same config setup for the java version tool chains. At this point, many sub-project gradle config files will need to be altered to change the java versions.

I'll also explore to see if I can setup multiple tool chains to support the different versions of java too. This will then require the gradlew to be ran in a different way, but it may allow dynamic support for different java versions.

I'm not sue what the ETA is on this. I will try to address this as time permits since I'd like to get it resolved too.

I know this topic is rebuilding prison, using gradle with a newer version of Java, but the existing Java 1.8 jars should work if used to compile against when using java 17 or java 21.

Since java 1.8 is a currently support version of Java, the simple solution is to install the latest release of Java 1.8 and then gradle will be able to perform a build of prison, automatically using the discovered java 1.8

@rbluer
Copy link
Collaborator

rbluer commented Apr 29, 2024

I think actually, now that I think about it, the issue you're having really is all about gradle not being able to find a java 1.8 instance on your system.

The actual solution to your problem would be for you to install the latest Java JDK-1.8, since that will include all of the latest security patches.

If I get prison to successfully compile for java 17 and 21, the gradle configs will NOT be set to either 17 or 21. They will remain at 1.8. So ideally, if you want a 17 or 21 build, you would have to modify that to be added gradle/libs.versions.toml file.

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

No branches or pull requests

2 participants