A Java library that compiles LESS CSS to CSS using the official JavaScript compiler via Rhino.
LESS CSS Compiler for Java is a library that allows Java applications to compile LESS (Leaner Style Sheets) source code into standard CSS. It solves the problem of integrating LESS preprocessing into Java-based build pipelines or server-side applications without requiring Node.js or external tools.
Java developers who need to compile LESS stylesheets within their Java applications, particularly those working on server-side web applications or build tools that require CSS preprocessing.
It provides an official-compatible LESS compiler that runs entirely within the Java ecosystem, offering thread-safe operation and seamless integration with existing Java projects without external dependencies.
LESS CSS Compiler for Java
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses the official LESS JavaScript compiler via Rhino and Envjs, ensuring compatibility with standard LESS language features, as verified by included compatibility tests.
The LessCompiler instance is explicitly designed to be thread-safe, allowing reuse across multiple compilation requests in concurrent Java applications.
Supports compiling from LESS strings to CSS strings or from files to files, providing versatility for different use cases in server-side processing.
Allows configuration with LESS compiler options like --relative-urls and --strict-math, enabling fine-tuned compilation as needed.
The README admits that @import with media queries is not fully supported, limiting compatibility with certain LESS workflows and features.
Requires additional libraries such as Rhino, Envjs, Apache Commons IO, and Lang, increasing project complexity and footprint compared to lighter solutions.
Based on LESS 1.7.0, it lacks support for newer features and optimizations from later versions, potentially causing compatibility issues with modern LESS code.
Running JavaScript within Java via Rhino can be slower than native Node.js execution, making it less suitable for high-volume or performance-critical applications.