ebyte-spark-j-c
v1.0.0
Published
A simple Java compiler wrapper using Node.js
Downloads
2
Readme
Ebyte Spark Java Compiler CLI
A simple command-line tool to compile Java source files quickly using Node.js and the system's installed Java compiler (javac). Designed for educational use, automation, and integration in Java learning environments.
✨ Features
- ✅ Check if Java are installed using
jcheck - ✅ Compile
.javafiles from the command-line usingjrun fileName.java - ✅ Clear output with helpful logs
- ✅ Works cross-platform (Windows/Linux/macOS)
- ✅ Lightweight and fast!
📦 Installation
Make sure you have Node.js installed. Then install globally using:
npm install -g ebyte-spark-j-cYou can also install locally in a project:
npm install ebyte-spark-j-c🚀 Usage
From the command-line
To compile a Java source file from your terminal:
jrun HelloWorld.javaIf javac is not found or Java is not installed, you'll see a clear error message.
Example Output
✅Compiling Java file: main.java ✅Running from directory: C:\Users\Ebed.Dev\Desktop\Open Source App Lib\test package ✅Hello World
If there is a syntax error:
!!!!! Compilation failed:
Test.java:3: error: ';' expected
System.out.println("Hello World")
^
1 error🧑💻 As a Node.js Module (API Usage)
You can import and use the compiler in your own Node.js scripts.
const { compileJava } = require('ebyte-spark-j-c');
compileJava('Test.java', (err, stdout, stderr) => {
if (err) {
console.error('Compilation failed:', stderr);
} else {
console.log('Compiled successfully!');
}
});🔧 CLI Check for Java Installation
The command also checks if Java and jcheck are installed and shows their version. If not, you will see:
!!!!! Java is not installed or not found in the PATH.
Error detail: spawn java ENOENT🤝Contributing
Contrubutions are welcome! Please read our Contributing Guidelines before submitting a pull request.
📜 License
MIT © 2025 Ebyte Code Labs
