- Node.js (v18 or higher) - Download from nodejs.org
- Java Development Kit (JDK) - Download from oracle.com or use OpenJDK
- Git (optional) - For version control
mkdir java-editor
cd java-editorCreate all the files I provided above in your project directory:
package.jsonmain.jspreload.jsindex.htmlstyles.cssrenderer.js
npm installMake sure Java is properly installed and accessible:
java --version
javac --versionBoth commands should return version information.
npm startFor development with DevTools:
npm run dev- Press
Tabto insert 4 spaces - Press
Shift+Tabto remove 4 spaces - Works in both editors
- Parentheses:
(automatically adds) - Brackets:
[automatically adds] - Braces:
{automatically adds} - Quotes:
"and'automatically add closing quotes - Smart behavior:
- Wraps selected text when typing opening character
- Skips closing character if cursor is before matching one
- Deletes matching pair when backspacing empty pair
- Auto-indents when pressing Enter between braces
- Theme toggle: Light/Dark mode with persistence
- Real Java compilation: Uses system
javaccommand - Real Java execution: Runs compiled programs
- Input support: Send input to running programs
- Timer functionality: Track coding time per pane
- Error handling: Clear feedback for compilation/runtime errors
- Modern UI: Clean, professional design with gradients
- Start the app:
npm start - Try the auto-completion:
public class Test { public static void main(String[] args) { System.out.println("Hello!"); } }
- Test compilation: Click "Compile" button
- Test execution: Click "Run" button
- Test input: Try a program that reads input:
import java.util.Scanner; public class Input { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("Enter your name: "); String name = sc.nextLine(); System.out.println("Hello, " + name + "!"); } }
- File save/open functionality
- Syntax highlighting with Monaco Editor
- Code folding
- Find/replace functionality
- Multiple file tabs
Java not found: Make sure Java is installed and in your system PATH Permission errors: On macOS, you might need to allow the app in Security & Privacy settings Compilation fails: Check that your Java syntax is correct and class name matches
# Build for current platform
npm run build
# Build for all platforms
npm run distThe built app will be in the dist folder.