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

Set GdxSetup source level to java 8 #7311

Merged
merged 2 commits into from
Dec 28, 2023
Merged

Set GdxSetup source level to java 8 #7311

merged 2 commits into from
Dec 28, 2023

Conversation

obigu
Copy link
Contributor

@obigu obigu commented Dec 28, 2023

Since Java 21 (LTS) is the default version when downloading java, many users (specially new libGDX users) are complaining new projects don't work. Even if libGDX iOS backend doesn't fully support Java 8 language features (see #5487) at this point I think, until we decide on the approach to move forward, we should change Gdx Setup source level to 8 on all modules.

@Tom-Ski
Copy link
Member

Tom-Ski commented Dec 28, 2023

Probably some kind of warning would be good. This is giving people the impression that those language features are going to be ok to use. And it's not just language features, but lots of the 'JDK' is not available. If people spend a lot of time creating their game/app with these features without incrementally testing the ios version (which is standard flow), it would be a pain to fix all issues.

@obigu
Copy link
Contributor Author

obigu commented Dec 28, 2023

Probably some kind of warning would be good. This is giving people the impression that those language features are going to be ok to use. And it's not just language features, but lots of the 'JDK' is not available. If people spend a lot of time creating their game/app with these features without incrementally testing the ios version (which is standard flow), it would be a pain to fix all issues.

True, warning added

@Frosty-J
Copy link
Contributor

Frosty-J commented Dec 28, 2023

This is especially true of GWT. Even really old Java methods such as String.format() are absent from it, and there's no indication that it won't work until you try to build (or sometimes it fails at runtime - even worse).

A separate discussion, but I don't think iOS and others should be enabled by default (especially on Windows and Linux where there is no Xcode). Most users who are starting out leave the boxes checked, increasing download time and the risk of things going wrong (e.g. the ZipFile error if both Android and iOS modules are enabled, requiring manual Tools installation). I have. I've also seen users think the Android SDK is required when they don't even want to build for Android.

@Tom-Ski
Copy link
Member

Tom-Ski commented Dec 28, 2023

I think that is fair enough. I would say for the purpose of easily adding these subprojects back in down the line, it would be better if all the scripts are there already, but probably just commented out in the settings.gradle as inclusions of sub projects. Otherwise it would be very challenging for people not familiar with Gradle to add back in a platform that they now want to target.

This would require changing the main generated script to remove all dependencies and configurations to their respective sub project build.gradle though. But in my experience this is better anyway due to plugin conflicts, and android gradle plugin being notoriously horrible when it comes to these cross platform projects, especially in their IDE integration.

This does make the dependencies a little harder to manage for the user if not familiar with Gradle as they all would be split (This is why it was done the way it is, to make having to learn gradle as minimal as possible for user, all deps and config just in one file), but maybe that is a sacrifice that would be overall beneficial.

@obigu
Copy link
Contributor Author

obigu commented Dec 28, 2023

Sure, that would be a separate PR though. @Tom-Ski are we happy with the changes?

@crykn crykn added this to the 1.12.2 milestone Dec 28, 2023
@crykn crykn merged commit 449619e into libgdx:master Dec 28, 2023
2 checks passed
@obigu obigu deleted the setupjava8 branch December 29, 2023 12:39
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.

None yet

4 participants