-
Notifications
You must be signed in to change notification settings - Fork 10
How to Use CompoundVM
CompoundVM is an optimized JDK (Java Development Kit) developed by ByteDance for enhanced compatibility and performance. This guide provides instructions on how to install, configure, and run Java applications using CompoundVM.
- Installation
- Quick Start
- Modes of Use
- Configuration
- Running Java Applications
- Advanced Usage
- Troubleshooting
- FAQ
- Support
- Supported OS: Linux (x64 and aarch64)
- Sufficient permissions to install software
Extract the archive and set up JAVA_HOME:
tar -xzvf CompoundVM_8.0.2_linux_x64.tar.gz
export JAVA_HOME=$(pwd)/CompoundVM_8.0.2_linux_x64
export PATH=$JAVA_HOME/bin:$PATHExtract the patch into your JDK 8 directory:
tar xzf CompoundVM_8.0.2_jvm_patch_linux_x64.tar.gz -C /path/to/jdk8Recommended GCC version: 8.x, 9.x.
- Clone the repository:
git clone https://github.com/bytedance/CompoundVM.git cd CompoundVM - Build CompoundVM:
For more build options, run:
make -f cvm.mk cvm8
make -f cvm.mk help - After installation, verify with:
You should see output indicating JVM 17 is enabled on JDK 8.
output/CompoundVM_8.1.0_linux_x64//bin/java -version output/CompoundVM_8.1.0_linux_x64//bin/java -server17 -version
CompoundVM supports two modes of operation:
Behaves identically to standard JDK8.
Example usage:
java -version
java -jar yourapp.jarTo enable the high-performance mode powered by JVM 17, add -server17 as the very first option in your command.
Example usage:
java -server17 -version
java -server17 -jar yourapp.jarThe
-server17option must come before all other options.
-
Standard Mode:
No special options required. Fully compatible with JDK8 applications. -
High Performance Mode:
Add-server17as the first argument to enable JVM 17 features and optimizations on top of JDK8.
CompoundVM supports standard JVM options as well as additional performance features.
-
JVM Options Example (Standard Mode):
java -Xmx2G -Xms512M -XX:+UseG1GC MyApp
-
JVM Options Example (High Performance Mode):
java -server17 -Xmx2G -Xms512M -XX:+UseG1GC MyApp
Refer to the Configuration Guide for more options.
CompoundVM is designed to be compatible with most Java applications. Use it as a drop-in replacement for your current JDK.
-
Run a JAR file (Standard Mode):
java -jar yourapp.jar
-
Run a JAR file (High Performance Mode):
java -server17 -jar yourapp.jar
-
Run a class file:
java com.example.Main
Or in high performance mode:
java -server17 com.example.Main
-
Build Tools Integration:
SetJAVA_HOMEin Maven, Gradle, or other tools to the CompoundVM directory. -
Native Libraries:
CompoundVM can load native libraries written in C, C++, and Assembly. -
Implicitly activate JVM17+JDK8 by default:
Set environment variableJAVA_OPTIONS=-server17.
- If
java -versiondoes not show CompoundVM, check thatJAVA_HOMEandPATHare set correctly. - For runtime errors, review the Issues page.
Q: Is CompoundVM compatible with standard Java applications?
A: Yes, CompoundVM aims for high compatibility with the official JDK.
Q: How do I update CompoundVM?
A: Download the latest release and repeat the installation steps.
Q: How do I enable high performance mode?
A: Add -server17 as the first option in your java command.
- GitHub Issues
- Discussion Forum
- Contact Maintainers
Scan QR code to join the WeChat discussion group:
