Getting Started: Java Ahead of Time compilation with VMKit
This page gives you the instructions on how to use the Java ahead of time compiler of VMKit.
- Checkout and build VMKit from SVN head.
- Compile into a dynamic library the core Java libs (e.g. GNU Classpath):
- cd tools/vmjc/libvmjc
- make ENABLE_OPTIMIZED=1 REQUIRES_FRAME_POINTER=1 (go get coffee)
- Update PATH to include LLVM and VMKit binaries (replace *_OBJ with your directory):
- export PATH=$(LLVM_OBJ)/Release/bin:$(VMKIT_OBJ)/Release/bin
- Update LD_LIBRARY_PATH to include the dynamic library previously compiled (replace VMKIT_OBJ with your directory):
- export LD_LIBRARY_PATH=$(VMKIT_OBJ)/Release/lib
- Use the llcj tool on a class or a jar file:
- llcj -S Foo.class (emit bytecode)
- llcj --main=Foo Foo.class (generate an executable)
- llcj -c Foo.class (generate an object file)