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

Add extra Java Options to Scala kernel #1397

Open
emlynazuma opened this issue Aug 8, 2024 · 1 comment
Open

Add extra Java Options to Scala kernel #1397

emlynazuma opened this issue Aug 8, 2024 · 1 comment

Comments

@emlynazuma
Copy link

Hi, I wonder if I could add extra Java options to kernel.json.
For my use case, I just need to add an --add-opens... argument during the kernel start.

❯ coursier bootstrap almond:0.13.14 --scala 2.12 --output almond --force
❯ ./almond --install --global --force
Installed scala kernel under /usr/local/share/jupyter/kernels/scala
❯ cat /usr/local/share/jupyter/kernels/scala/kernel.json
{
  "argv": [
    "java",
    "--add-exports=java.base/sun.nio.ch=ALL-UNNAMED",   # how can I add this line?
    "-jar",
    "/usr/local/share/jupyter/kernels/scala/launcher.jar",
    "--connection-file",
    "{connection_file}"
  ],
  "display_name": "Scala",
  "language": "scala"
}%

It seems there are directives to add Java options.
However, It is unclear how to utilize these directives, e.g. where to put these directives code? how to execute them?

//> using javaOpt "-Xmx10g"
//> using javaOpt "-Dfoo=bar"

For now, I have to write a script to post-modify kernel.json after almond has installed the kernel.
It will be great if I can achieve it during almond install stage.

@tongwaiazuma
Copy link

After switching to sh.almond::launcher:0.14.0-RC15, I found that there is a --java-opts to fulfill my need.
Thanks very much!

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

No branches or pull requests

2 participants