- A Ring source tree with its headers and library:
ring/language/include, andring.lib(Windows) orlibring(Linux/macOS) inring/lib. - A C compiler: clang or MSVC on Windows, gcc or clang on Linux/macOS.
- A JDK 17 or later (for
jni.h,javac,jar, and to run the generator).
All commands start from extensions/ringjava unless a path says otherwise. Set JAVA_HOME (the batch files default to C:\PL\Java\jdk-25.0.5.1) and
RING_HOME (default B:\ring).
-
Windows with clang:
buildclang_win.bat(it runs step 2 too). By hand:clang --target=x86_64-pc-windows-msvc -shared -O2 -D_CRT_SECURE_NO_WARNINGS -I<ring>/language/include -I<jdk>/include -I<jdk>/include/win32 ring_java.c <ring>/lib/ring.lib -o ../../bin/ring_java.dll -
Linux:
sh buildgcc.sh(writeslibring_java.so,ringjava.jarandparamnames.txttoring/lib; needsJAVA_HOMEand gcc). Tried on Ubuntu (WSL, Ring 1.28, Temurin JDK 21): the whole test suite passes, and the tutorials and applications run in a window (WSLg). At run timelibjvm.somust be found: the extension loads it fromJAVA_HOMEor frombin/ringjava.cfg. -
macOS:
sh buildclang.sh(writeslibring_java.dylibandringjava.jartoring/lib; not tried yet).
The JVM library is not linked: the extension loads jvm.dll / libjvm.so from the JDK at run time, so the same ring_java works with any JDK 17+.
buildjava.bat (buildjava.sh on Linux and macOS) compiles java/ringjava/*.java and tools/javatools/GenRing.java with --release 17 and packs ringjava.jar.
Needed when you change the manifest (tools/javatools/javamanifest.txt), the generator (GenRing.java) or want other packages:
cd tools/javatools
java GenRing.java ../../libraries/javalib/generated @javamanifest.txt
It takes about two seconds and writes one <package>.ring file for each package. Then check that every file loads:
cd tools/javatools
ring checkgenerated.ring
The classes of a jar of your own: java GenRing.java <output folder> --jar my.jar com.mycompany.tools.
powershell samples/UsingJava/tests/run.ps1
Expected: 367 checks passed, 0 failed.
The manual is written in Markdown in docs/src/*.md. The HTML site and the PDF are built with ringdoc (cd docs; ringdoc shoot; ringdoc build --refresh; ringdoc pdf, see docs/src/testing.md).
ring tools/javatools/makepackage.ring makes extensions/ringjava.zip from the files that git tracks; makeruntime.ring and bundle.ring are for the programs that
are given to other people. See docs/src/distribution.md.