-
Notifications
You must be signed in to change notification settings - Fork 220
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
WARNING: A restricted method in java.lang.System has been called (JDK24) #1067
Comments
@khmarbaise Which version of maven ? |
I have tested with Maven 4.0.0-beta-4, 4.0.0-beta-3, 3.9.X(all versions), 3.8.X(all versions)... A simple
The README tells already something like this:
If I correctly understand the warning which is related to the usage of this methods: |
We need to add argument that to the startup scripts. |
Wouldn't it be better to go the way that jline detects which JDK it is running under automatically for example via a multi-release jar which handles that ... using FFM (JDK22+) ? (Just an idea... not familiar with the JLine code)... |
I think JLine almost always needs native access, either because of the FFM provider or because it will need to load a native library. |
Also with other projects, our default validation fails. [INFO] --- enforcer:3.5.0:enforce (enforce-bytecode-version) @ maven-filtering --- Error: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.5.0:enforce (enforce-bytecode-version) on project maven-filtering: |
That's unrelated and I think the detection is too strict. In this case, the JLine FFM provider requires JDK 22, but those classes are optional. Maven can be switched to using individual JLine jars if needed, that may help. |
I've raised apache/maven#1718 |
Raised apache/maven#1719 |
Closing this one as there's not much JLine can do for the JDK24 warning and for the enforcer, we need to use individual jars. |
I just stumbled across that JDK warning and the search led me here. Great to see the community noticing and reacting to these changes quickly. 😃👍🏾 I think everybody in this thread is aware, but just in case: On JDK 22 and 23, this message was an error that was triggered by FFM. On 24, it was temporarily downgraded to a warning, so JNI could be onboarded. Specifically, this is the list of restricted methods that trigger the message (once JDK 24 is GA, that link breaks and the list should be here). In some future release, this warning will become an error again (this time including JNI). To make all this easier to understand for the user, I recommend to place calls to restricted methods in a Speaking of If there's interest in these changes, I can open a PR. |
Won't that only work if the offending library is loaded from the module-path? |
Apologies, disregard, I misread this from the wrong project. |
Currently the jline-3.26.3 is used in Maven Core which produces a WARNING like this:
This warning is issued while running under JDK24.ea.13
The text was updated successfully, but these errors were encountered: