This is a Next.js project bootstrapped with v0.
- Framework: Next.js
- Language: TypeScript
- Styling: Tailwind CSS with Radix UI primitives (shadcn/ui style components)
- Icons: Lucide React
This project achieves client-side Java execution without requiring a backend server by combining two core technologies:
- CheerpJ (WebAssembly JVM): A WebAssembly-based Java Virtual Machine that runs completely client-side in the browser. It intercepts
System.out/System.errto capture output directly to the UI. - ECJ (Eclipse Compiler for Java): Because CheerpJ ships as a JRE (Java Runtime Environment) and lacks
javac, the app uses the Eclipse Compiler for Java (ecj.jar).- Execution Flow: The user's Java code is intercepted and saved to a virtual file system (
/str/). The app invokes the ECJ compiler viacheerpjRunMainto compile the.javafile into a.classfile. CheerpJ then executes the compiled bytecode locally in the browser. - Safeguards: To prevent infinite loops or memory crashes, the compiler has a 30-second timeout, the execution has a 10-second timeout, and output length is capped at 1MB.
- Execution Flow: The user's Java code is intercepted and saved to a virtual file system (
- Code Editor:
@monaco-editor/reactpowers the in-browser IDE with syntax highlighting and code completion for Java. - PDF Processing:
pdfjs-distis used to parse uploaded computer science lab handouts (PDFs) and dynamically turn them into an interactive Jupyter-style notebook. - Markdown & Math Rendering:
react-markdownis used alongsideremark-mathandrehype-katexto perfectly render complex LaTeX formulas (like Euclidean distance formulas found in the labs). - Syntax Highlighting:
prismjsis used for rendering static Java code blocks outside of the interactive Monaco editor.
This repository is linked to a v0 project. You can continue developing by visiting the link below -- start new chats to make changes, and v0 will push commits directly to this repo. Every merge to main will automatically deploy.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
To learn more, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
- v0 Documentation - learn about v0 and how to use it.