-
Notifications
You must be signed in to change notification settings - Fork 161
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
Running jbang to execute inline code produces a warning about incubator modules #1872
Comments
One way of doing this would be for JBang to switch to Edit: I just tested, if we would switch to |
I used ALL-SYSTEM in early days to make it as easy as possible to use any java code - if we do "all-default" you won't get access to the incubating ones .... Like, if we use ALL-DEFAULT then yes, we dont get the warning, but now you need to list I guess we could conside making it that we use ALL-DEFAULT by default and when using --enable-preview add ALL-SYSTEM but boy I feel this is tedious. Ultimately I wish the openjdk would allow us as users to state "yes, we know we are doing it but please don't mess up my console output flag" |
the code is here: https://github.com/openjdk/jdk/blob/c88e081a6a0a00d7e7e5f2337f942a1d6c3b5110/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java#L1019 and it just prints directly to System.err.println() ...and it happens before any code is granted access to setup/rewire stderr so can't even do some trickeries. |
fyi #992 explains why we added that flag, basically without it you have to get really verbose if you use modules. |
That's true, but you only get that in the case you're using incubator modules, which I don't think is the norm, so defaulting to ALL_DEFAULT would at least get rid of those annoying messages in most cases. In the case you really need them (or any other non-default module) you can still do |
I reckon we could add that --enable-preview adds system instead of default? As inthink you need preview anyway to actually use it ( at least in java) |
With a fresh install of Ubuntu 24.04 and JBang, I get the following warning when I execute a simple hello world example using the
-c
command:Even though this warning is emitted by JDK (I think), it's frustrating and likely offputting for new users. Can we suppress this in some way?
To Reproduce
Steps to reproduce the behavior:
docker run -it ubuntu:24.04 /bin/bash
to get this.apt update && apt install -y curl
curl -Ls https://sh.jbang.dev | bash -s - app setup
jbang -c 'println("Hello, World!")'
Expected behavior
No warnings should be visible to the user, particularly during a Hello World scenario.
JBang version
JDK version
This is the default JDK installed by JBang when no JDK is found on the system.
The text was updated successfully, but these errors were encountered: