This project demonstrates how to run JavaScript from Java using GraalVM. Specifically, it showcases the integration of the KaTeX JavaScript library within a Java project.
- Java 17 or higher: Ensure you have GraalVM JDK 17 or higher installed.
- GraalVM: Download and install GraalVM from GraalVM's official website.
- JavaScript Support: After installing GraalVM, run the following command to install JavaScript support:
gu install js
The main goal of this project is to render LaTeX expressions using the KaTeX JavaScript library from within a Java application. This is achieved using GraalVM's polyglot capabilities.
- Clone the repository
- Install GraalVM and JavaScript support:
gu install js - Build the project using Maven:
mvn clean install
To run the project, execute the Main class. This class initializes the KaTeX renderer and renders several LaTeX expressions to MathML.
mvn exec:java -Dexec.mainClass="de.Eugen.Main"
The program will output the LaTeX expressions and their corresponding MathML representations.
License This project is licensed under the MIT License. See the LICENSE file for details.