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.1.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.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: java_magic-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 7482213d3676401beaae66177adeb11963b9f4c87c63e5f8c2c8695f87e089ab
MD5 be7b0fd9c70d1331a5c307836dc2d70f
BLAKE2b-256 9fffc23df7b6a4fdb944c9815a79db109c5f700a9c33609d134ee5b70d673327

See more details on using hashes here.

File details

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

File metadata

  • Download URL: java_magic-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0c55e539438e15cba33979404fc599ba18d9361c5877bf8eacf5d70ea32c001d
MD5 6c79b440fe391c052d65b96237df535a
BLAKE2b-256 b4462b84b12e29049f25760b18c643141aa4fdb94961b957716da89ac70edd6f

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