-
Notifications
You must be signed in to change notification settings - Fork 2
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
Use of eclipse settings "org.eclipse.jdt.core.prefs" #17
Comments
Hi @dovogt, the good news is that the compiler should pick up the properties just fine with the code you specified above. Did you try this and run into any issues? The bad news is that, from your description, there is different problem with your approach. So let's dive into this:
Source compatibility (i.e. javac's Java is not forward-compatible. This means, that in Java X, you cannot read bytecode from any Java version that was released after version X.1 Specifically, in your case, you target Java 17 bytecode which cannot be used from Java 11. Instead, Java is backward-compatible. This means that bytecode from Java Y can be read in any Java version released after version Y. So what you want to do here, is setting Just one more thing to keep in mind: Using So, finally, what I recommend in your case, is ditching compileJava {
options.release = 11
} Footnotes
|
Thank you very much for your detailed help. I have entered the following in the Eclipse settings: and in the build.grade After creating the classes, the classes either had bytecode 61 or, in the second case, bytecode 55 compileJava {
|
I just checked and can confirm it works. However, if you are specifying |
I have created the following configuration. If I set options.relase=11, will the configuration from the settings still be loaded? Or do I have to leave out release that it uses the settings?
|
I didn't check this specifically, but |
When I set the release parameter, it seems to use this and no longer the settings from the Eclipse. I have removed it and then it seems to work. Thanks again for your support |
I had to set the options.release= 11 after all. By using Java 17 for execution, Java 17 is entered as the minimum version in the modules file for publish. As a result, an error occurs when downloading the dependency. |
I am currently using your plugin and previously used the plugin de.set.ecj. The Eclipse settings were used there. Can I configure your plugin so that the Eclipse settings are used?
compileJava {
options.compilerArgs << '-properties' << '$projectDir/.settings/org.eclipse.jdt.core.prefs'
}
The background is that I need source compatibility on Java 11, but target compatibility on 17 and compliance on Java 17. Unfortunately, this cannot be mapped with the Gradle settings.
The goal is that my library can be used in Java 11 projects
The text was updated successfully, but these errors were encountered: