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.2.tar.gz (3.4 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.2-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: java_magic-0.1.2.tar.gz
  • Upload date:
  • Size: 3.4 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.2.tar.gz
Algorithm Hash digest
SHA256 a53125a34788fdd98c84a9330bd128eb4e7612070c68270242fee94ca8d7eda0
MD5 232beeb51d3e99ea4ea840c74b7b9612
BLAKE2b-256 d7648c569ddf28b922c7b0872710bcef95d909037718fd01832ecb19d447e5aa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: java_magic-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.0 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e77e56549b8e9fa9894585613962460aaab0d958a89be44af9010c4dac0735c1
MD5 fe9ec0ce3973f4feddda317ad93b2f50
BLAKE2b-256 43e43b6f1d6f1b54ee11fa0e6ed997e5ef719989b9afe56ba339433eb9b86731

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