Skip to main content

Magic cell para ejecutar Java de forma interactiva en Jupyter y Colab

Project description

Jupyter Java Magic (with Interactive Mode) A lightweight Jupyter Notebook extension to write, compile, and execute Java code directly inside cells. It features automatic Google Colab setup and real-time interactive console input support (Scanner, System.in).

🛠️ Installation

pip install java-magic

🚀 Quick Start

  1. Load the extension In your first notebook cell, load the magic:
%load_ext java_magic
  1. Run standard Java code You don't even need a main class wrapper for simple snippets; the extension handles it automatically:
%%java
System.out.println("Hello from Jupyter!");
  1. Run interactive Java code If the extension detects Scanner or System.in, it automatically switches to an interactive terminal loop:
%%java
import java.util.Scanner;

Scanner scanner = new Scanner(System.in);
System.out.print("Enter your name: ");
String name = scanner.nextLine();
System.out.println("Hello, " + name + "!");

⚙️ Configuration By default, generated .java files are kept in your directory. If you want them automatically deleted after execution, run:

%config JavaMagics.remove_java_file = True

📄 License MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

java_magic-0.1.3.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

java_magic-0.1.3-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file java_magic-0.1.3.tar.gz.

File metadata

  • Download URL: java_magic-0.1.3.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for java_magic-0.1.3.tar.gz
Algorithm Hash digest
SHA256 449b12e6aa0081b79d80de7bb14001a7e7d70d7fc3d02b6b0bc67193c73939fd
MD5 045acc0af9c7c3079fbb25121593fae2
BLAKE2b-256 146cd2bb792b705311d29150b4b51eef3295d1d577160650866825c3101d882e

See more details on using hashes here.

File details

Details for the file java_magic-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: java_magic-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for java_magic-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1fad8fc0671f48a7b9b1993631faa4197eea5ec7e77601c18872252220897c0a
MD5 23d888e260cdd6a50243423c8e831533
BLAKE2b-256 fb57fb16a61936420d15da5ef86459802d5f92e1f510f9227b2b4a56de061364

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page