Skip to content

MHuzaifaMemon/Notepad-Java-Compiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notepad-Java-Compiler

A simple Java Swing text editor (Notepad-like) with:

  • Open / Save / Print
  • Word wrap
  • Light/Dark theme (FlatLaf)
  • Font family + font size controls
  • Text color picker
  • A Compile & Run button to compile/run a saved .java file (Windows)

Requirements

  • Windows (the in-app Compile & Run button uses a temporary .bat script)
  • JDK installed (so java and javac are available)
  • The dependency jar is already included in this repo:
    • external_jars/flatlaf-3.1.jar

Run (easiest on Windows)

Double-click:

BatchFile.bat

This builds to out/ and launches the app.

Build & Run (command line)

From the project root:

PowerShell

cd "g:\Notepad-Java-Compiler"

if (Test-Path out) { Remove-Item -Recurse -Force out }
New-Item -ItemType Directory -Path out | Out-Null

javac -cp "external_jars/*" -d out src\*.java src\fonts\*.java
java  -cp "out;external_jars/*" Main

CMD

cd /d g:\Notepad-Java-Compiler

rmdir /s /q out
mkdir out

javac -cp "external_jars/*" -d out src\*.java src\fonts\*.java
java  -cp "out;external_jars/*" Main

Using “Compile & Run” inside the app

  1. Type or paste Java code into the editor.
  2. Save the file with a .java extension.
  3. Click Compile & Run.

Notes:

  • Your system must have javac on PATH.
  • It runs the compiled class from the same folder where you saved the file.

Troubleshooting

  • javac is not recognized: install a JDK and ensure JAVA_HOME/PATH is set.
  • ClassNotFoundException for FlatLaf classes: make sure you run with the classpath including external_jars/*.
  • Icons/fonts not showing: run commands from the project root (paths like src/s.png and src/fonts/JetBrainsMono.ttf are file-based).

Project notes

  • No Maven/Gradle build is used here; it’s a plain javac/java project.
  • If you want a distributable .jar, you’ll likely want to refactor file-based assets (icons/fonts) into classpath resources first.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors