RingJavafor Ring

RingJava

Call any Java class from Ring with simple syntax: the Java class library, your own jars and the packages of Maven Central. Build Swing and JavaFX windows, databases with JDBC and web servers โ€” all in Ring.

181Packages
4,106Ring classes
28Tutorials
17Swing samples
47Applications
20Maven packages tried
27Test files

A first taste#

Ring
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]

The classes are real Ring classes with the same method names as the Java ones, so inheritance and ordinary Ring syntax just work. The JVM runs inside the Ring process, so a call costs microseconds and there is no server to start.

What is inside#

๐ŸŽ“
Tutorials28 lessons, from a first look to a web server and a JSON API. Each one has a program with its real output.
๐Ÿ”Œ
Simple syntaxoObj.method(), static members, fields, using a package, and a Ring function wherever Java wants a listener.
๐Ÿ“š
The class libraryStrings, collections, dates, files, regex, networking, crypto, XML, JSON and more: 4,106 classes of 181 packages.
๐Ÿ”Ž
QueriesjQuery: filter, sort, group and total a Ring list or a Java collection in one chain.
๐Ÿ”
Callbacks and threadsPass Ring code wherever Java expects an interface; run executors and wait for them.
๐ŸชŸ
Swing and AWTEvery control and event of Swing, with short builders: jWindow, jButton, jRow, jGrid, JCanvas.
๐Ÿ“Š
Charts and drawingJChart: bar, line, scatter and pie charts; arcs, polygons and pictures on a JCanvas.
๐ŸŽจ
JavaFXJavaFX windows from Ring: scenes, controls and animation.
๐Ÿ—„๏ธ
DatabasesJDBC with H2 and SQLite, and JavaDatabase: tables, rows and queries without SQL.
๐ŸŒ
Web serverJavaWebServer: routes that are Ring functions, forms, JSON in one call, and jHttpGet for a client.
๐Ÿ“ฆ
Maven packagesjMaven downloads any package of Maven Central with its dependencies: 20 of them are tried for real.
๐Ÿ“–
Class referenceEvery Java class that has a Ring class: constructors, fields and methods with their Ring calls.
๐ŸŽฎ
47 applicationsCalculator, Notepad, Paint, Tetris, Sudoku, Minesweeper and more โ€” each tests itself.

See it running#

Calculator Sokoban Tetris Eight queens

How the documentation is organized#

PartWhat it is for
StartOverview, Getting started (install, the JDK, the first programs), Installing and distributing, Core concepts and How it works
Tutorialslearning by building programs: 28 lessons from a first look to a web server, each with its program and real output
Using Javahow each area works and which functions and classes it has: the core API, queries, callbacks and threads, windows and events, window builders and charts and drawing
Samplesthe applications, the samples and the galleries with a screenshot, the source and the command of every window: applications, Swing and JavaFX
The Java ecosystemMaven packages and the packages tried, databases, the web server and JavaFX
Insidethe rules and limits to read before a long program, the generator and testing
Referencethe function index and the class reference with every Java class that has a Ring class
Appendixa quick introduction to Ring, for readers who are new to the language, and troubleshooting

How the package is organized#

FolderContents
bin/ring_java.dll, ringjava.jar and load/java.ring (what load "java.ring" finds)
libraries/javalib/The Ring library: functions, the builders, and generated/: the Ring classes of 181 Java packages
extensions/ringjava/C source of the extension (ring_java.c) and the Java source of the bridge, with the build scripts
tools/javatools/The generator GenRing.java and its manifest, and checkgenerated.ring
samples/UsingJava/tutorials/The program of each tutorial, named by chapter (ch01_first_look.ring ...)
samples/UsingJava/introduction/Short samples for each area
samples/UsingJava/gui/ and ecosystem/Swing windows; Maven packages, JDBC and JavaFX
samples/UsingJava/applications/47 complete programs, each in its own folder with a self test
samples/UsingJava/tests/The automated tests (run.ps1, run.sh)
docs/docproject.ring and the manual: docs/src is the Markdown, docs/site is the built site
RingJava - use Java classes and methods from Ring programs.