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 your-package-name

🚀 Quick Start

  1. Load the extension In your first notebook cell, load the magic:
%load_ext your_package_module_name
  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.0.tar.gz (3.4 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: java_magic-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 361e9425288f94c4624ec6c10013f7ccd3c376434da49b62c62b1a65a94aa101
MD5 0c00dd9bdd4bb98089c71bc96bd64f8a
BLAKE2b-256 cbeae2be4554c7842fb430c022507caf7d1bc7d4dce401a19bf22318146efc5f

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