Skip to content

Instantly share code, notes, and snippets.

@tueda
Last active February 21, 2024 04:56
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save tueda/a200b3f747d0fc864be8b4dd09be5a1e to your computer and use it in GitHub Desktop.
Save tueda/a200b3f747d0fc864be8b4dd09be5a1e to your computer and use it in GitHub Desktop.
Java-Colab.ipynb
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tueda
Copy link
Author

tueda commented Nov 14, 2022

@jmmanipadam You need to open the notebook file in Colab (copy&paste code doesn't work), because you need to switch the Jupyter Kernel type to "java" (impossible from the Colab UI, saved in the .ipynb file). That is why I made this template notebook.

@benrobideau
Copy link

Does this still currently work? I've been running into the issue of a never-ending "Connecting...". I've been troubleshooting for about a day with no luck.

@tueda
Copy link
Author

tueda commented Dec 13, 2022

Oh, now the Java Kernel actually seems to stop at "Connecting"...

SpencerPark/IJava#138
googlecolab/colabtools#3267

@tueda
Copy link
Author

tueda commented Dec 21, 2022

@tueda
Copy link
Author

tueda commented Feb 21, 2024

For reference, nowadays the easiest way to run Java on Colab would be:

  1. Copy and paste 4 lines in https://github.com/jupyter-java#installing-in-online-jupyter-notebooks, and run them.
  2. Change runtime type to java (IJava/j!).

Then the above examples work well (including %maven ...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment