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

23.0.1 breaks ///usr/bin/env java --source 21 "$0" "$@"; exit $? causes "error: exporting a package from system module java.base is not allowed with —release" #10014

Open
HolgerMassmann opened this issue Nov 2, 2024 · 2 comments
Assignees
Labels

Comments

@HolgerMassmann
Copy link

Describe the issue
///usr/bin/env java --source 21 "$0" "$@"; exit $? causes "error: exporting a package from system module java.base is not allowed with —release"

Steps to reproduce the issue
SDKMAN installed 23.0.1-graal on MacOS M1

///usr/bin/env java --source 21 "$0" "$@"; exit $?

import java.time.ZoneId;
import java.time.ZonedDateTime;

public class Utc2 {

   public static void main( String[] args ) {
    System.out.printf( "Epoch seconds: %1$d%n", ZonedDateTime.now().toEpochSecond() );
  }
}
$ sw_vers
ProductName:		macOS
ProductVersion:		15.0.1
BuildVersion:		24A348

More details
Save the script above as Utc2, chmod 755 Utc2 and executing ./Utc2 the following error message printed:

error: exporting a package from system module java.base is not allowed with --release
1 error
error: compilation failed

This works with 22.0.1-graal or 23-open.

@HolgerMassmann HolgerMassmann changed the title ///usr/bin/env23.0.1 breaks java --source 21 "$0" "$@"; exit $? causes "error: exporting a package from system module java.base is not allowed with —release" 23.0.1 breaks ///usr/bin/env java --source 21 "$0" "$@"; exit $? causes "error: exporting a package from system module java.base is not allowed with —release" Nov 2, 2024
@HolgerMassmann
Copy link
Author

Probably does not work with 23-graal, but not tested

@HolgerMassmann
Copy link
Author

Hit wrong button

@oubidar-Abderrahim oubidar-Abderrahim self-assigned this Nov 4, 2024
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