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

Python extension is required when using VS Code notebooks with IJava kernel #4526

Closed
ronglums opened this issue Jan 27, 2021 · 9 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@ronglums
Copy link
Contributor

When using VS Code notebooks with the IJava kernel, the Java kernel doesn't show up in the kernel picker unless the Python extension is installed. The expectation is the Java scenario doesn't have any dependencies on Python (and the Python extension).

image

@ronglums ronglums added the bug Issue identified by VS Code Team member as probable bug label Jan 27, 2021
@DonJayamanne
Copy link
Contributor

@IanMatthewHuff has some background info about this issue.

@DavidKutu
Copy link

I couldn't repro this:
image
We might've fixed it already

@DavidKutu
Copy link

I'm moving this to validate, it should be fixed on our next release.

If somebody finds a repro, feel free to put it back.

@IanMatthewHuff
Copy link
Member

Adding David just to distinguish the work from the validation.

@IanMatthewHuff
Copy link
Member

IJava install options, as this might make a difference in where the kernelspec is placed.

Install the java kernel.

optional arguments:
  -h, --help            show this help message and exit
  --user                Install to the per-user kernel registry.
  --sys-prefix          Install to Python's sys.prefix. Useful in conda/virtual environments.
  --prefix PREFIX       Specify a prefix to install to, e.g. an env. The kernelspec will be installed in PREFIX/share/jupyter/kernels/
  --replace             Replace any existing kernel spec with this name.
  --classpath ENV       A file path separator delimited list of classpath entries that should be available to the user code. **Important:** no matter what OS, this should use forward slash
                        "/" as the file separator. Also each path may actually be a simple glob.
  --comp-opts ENV       A space delimited list of command line options that would be passed to the `javac` command when compiling a project. For example `-parameters` to enable retaining
                        parameter names for reflection.
  --startup-scripts-path ENV
                        A file path seperator delimited list of `.jshell` scripts to run on startup. This includes ijava-jshell-init.jshell and ijava-display-init.jshell. **Important:** no
                        matter what OS, this should use forward slash "/" as the file separator. Also each path may actually be a simple glob.
  --startup-script ENV  A block of java code to run when the kernel starts up. This may be something like `import my.utils;` to setup some default imports or even `void sleep(long time) {
                        try {Thread.sleep(time); } catch (InterruptedException e) { throw new RuntimeException(e); }}` to declare a default utility method to use in the notebook.
  --timeout ENV         A duration specifying a timeout (in milliseconds by default) for a _single top level statement_. If less than `1` then there is no timeout. If desired a time may be
                        specified with a `TimeUnit` may be given following the duration number (ex `"30 SECONDS"`).

@IanMatthewHuff
Copy link
Member

(javaEnv) MININT-ST2TT53:~ ianhuff$ python ./Desktop/ijava-1.3.0/install.py --sys-prefix
./Desktop/ijava-1.3.0/install.py:164: DeprecationWarning: replace is ignored. Installing a kernelspec always replaces an existing installation
  install_dest = KernelSpecManager().install_kernel_spec(
Installed java kernel into "/Users/ianhuff/opt/miniconda3/envs/javaEnv/share/jupyter/kernels/java"

@IanMatthewHuff
Copy link
Member

(javaEnv) MININT-ST2TT53:~ ianhuff$ python ./Desktop/ijava-1.3.0/install.py --user
./Desktop/ijava-1.3.0/install.py:164: DeprecationWarning: replace is ignored. Installing a kernelspec always replaces an existing installation
  install_dest = KernelSpecManager().install_kernel_spec(
Installed java kernel into "/Users/ianhuff/Library/Jupyter/kernels/java"

@IanMatthewHuff
Copy link
Member

@DavidKutu @ronglums Looks like this was the issue. On the IJava page they use install.py --sys-prefix as their example install command, which I used. This places the kernelspec in a env local location, so without the python interpreter to locate the env the kernel spec can't be found (the situation that I was in the first time I tried this). However with the --user option the kernelspec was installed into the user specific kernelspec location and I was able to run the kernel without the python extension installed / activated.

@IanMatthewHuff
Copy link
Member

Validated.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

5 participants