RingJava is a package for the Ring programming language that enables developers to use Java classes and methods directly from Ring. The package hosts the Java virtual machine (JVM) inside the Ring process (JNI invocation API) and talks to it through a small Java bridge. The Java class library (java.base, java.sql, java.xml, java.desktop with AWT and Swing, java.net.http, java.logging ...), and any jar of your own or from the Java ecosystem, can be used from Ring with the same simple syntax.
ringpm install ringjava from ringpackages
load "java.ring"
using {
"java.lang"
"java.util"
}
? Math.max(3,9) # 9: a static method
oSB = new StringBuilder("Hello")
oSB.append(", Ring!")
? oSB.toString() # Hello, Ring!
? oSB.length() # 12
oList = new ArrayList
oList.add("pear")
oList.add("apple")
Collections = new Collections
Collections.sort(oList)
? oList.toString() # [apple, pear]
oList.sort("byLength") # Ring code that Java runs
func byLength aArgs
return len(aArgs[1]) - len(aArgs[2])| Folder | Content |
|---|---|
extensions/ringjava |
the C extension ring_java.c and the Java bridge (java/ringjava/*.java) with the build scripts |
libraries/javalib |
the Ring library and generated/: the Ring classes of 181 Java packages (4,100+ classes, 233,000 lines) |
bin/ |
ring_java.dll, ringjava.jar, load/java.ring (what load "java.ring" finds) |
tools/javatools |
the generator GenRing.java and its manifest, and checkgenerated.ring |
samples/UsingJava |
introduction (short programs), gui (windows), ecosystem (Maven packages, JDBC, JavaFX), tutorials (28 lessons), applications (47 programs) and tests (the automated tests) |
docs/src |
the manual in Markdown |
docs |
docproject.ring and the built manual in docs/site (index.html, pdf/RingJava-documentation.pdf); rebuild with cd docs; ringdoc build; ringdoc pdf |
The package comes with many samples and applications:
MIT License.


