Kotlin / kotlin-jupyter

Kotlin kernel for Jupyter/IPython
Apache License 2.0
1.09k stars 106 forks source link

Can't find JVM bin #386

Closed AvneeshSarwate closed 1 year ago

AvneeshSarwate commented 1 year ago

I installed kotlin-jupyter using miniconda, with jupyter and kotlin-jupyter being the only packages installed in a new conda environment.

When running jupyter console --kernel=kotlin I get the following error - it seems the Homeexport directory in the final line is the problem, given that the file /Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/bin/java exsists

❯ jupyter console --kernel=kotlin
Traceback (most recent call last):
  File "/Users/avneeshsarwate/opt/miniconda3/envs/kotlin-env/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Users/avneeshsarwate/opt/miniconda3/envs/kotlin-env/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/avneeshsarwate/opt/miniconda3/envs/kotlin-env/lib/python3.10/site-packages/run_kotlin_kernel/__main__.py", line 10, in <module>
    main(sys.argv)
  File "/Users/avneeshsarwate/opt/miniconda3/envs/kotlin-env/lib/python3.10/site-packages/run_kotlin_kernel/__main__.py", line 6, in main
    run_kernel(*args[1:])
  File "/Users/avneeshsarwate/opt/miniconda3/envs/kotlin-env/lib/python3.10/site-packages/run_kotlin_kernel/run_kernel.py", line 12, in run_kernel
    run_kernel_impl(*args)
  File "/Users/avneeshsarwate/opt/miniconda3/envs/kotlin-env/lib/python3.10/site-packages/run_kotlin_kernel/run_kernel.py", line 72, in run_kernel_impl
    subprocess.call([java] + jvm_args + ['-jar'] + debug_list + jar_args)
  File "/Users/avneeshsarwate/opt/miniconda3/envs/kotlin-env/lib/python3.10/subprocess.py", line 345, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/Users/avneeshsarwate/opt/miniconda3/envs/kotlin-env/lib/python3.10/subprocess.py", line 969, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Users/avneeshsarwate/opt/miniconda3/envs/kotlin-env/lib/python3.10/subprocess.py", line 1845, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Homeexport/bin/java'
ileasile commented 1 year ago

Hello! What are the values of JAVA_HOME and KOTLIN_JUPYTER_JAVA_HOME environment variables in your environment? If JAVA_HOME has wrong value, please fix it

AvneeshSarwate commented 1 year ago

Ah, the value of JAVA_HOME was /Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Homeexport due to a typo in my shell config. Thank you!