站内导读

中文 Lukyt 是用 Lua 编写的小型 JVM,支持 Java 6,主要目的是在 OpenComputers 模组中运行 Java 程序。它提供与 OCJ 共用的 OpenComputers Java API,使程序在两种运行方式下保持兼容,并带有 Lua 互操作接口,两者均有 javadoc。与 Luje 不同,它侧重 OC 与 Lua 互操作特性。JVM 本身独立于命令行程序,适合想在 OC 环境运行 Java 软件的开发者。

README · 详细文档

来源 · 查看原文

Lukyt

Lukyt is a toy project, a small JVM made in Lua supporting Java 6. The most important reason i made it (other than being a toy project) was to run it on the OpenComputers mod. I am currently porting AWT to it to use Java software on OpenComputers.

This also supports a OpenComputers Java API shared with OCJ (link to come, will be released by @TYKUHN2), this way programs are compatible for both way of running Java on OC, its javadoc is available on my website, Lukyt also have a Lua interop, which also haves a javadoc.

Note that unlike Luje, this is aimed towards features: OC and Lua interoptability.

Roadmap

How to use?

The JVM itself can be used by any program and is independent from the command-line program.

The command line program allows to execute classes.

To launch the HelloWorld test, just do:

lua lukyt.lua --classpath=test HelloWorld

Examples

Here is an example of the OC integration:

import cil.li.oc.Components;
import cil.li.oc.proxies.GPUProxy;

public class ComponentTest {

	public static void main(String[] args) {
		GPUProxy gpu = Components.getPrimary("gpu");
		gpu.setBackground(0x2D2D2D);
		gpu.fill(1, 1, 160, 50, ' ');
		System.out.println("Filled screen with color 0x2D2D2D");
	}

}

同类项目 · 好玩项目