站内导读
中文 Lukyt 是用 Lua 编写的小型 JVM,支持 Java 6,主要目的是在 OpenComputers 模组中运行 Java 程序。它提供与 OCJ 共用的 OpenComputers Java API,使程序在两种运行方式下保持兼容,并带有 Lua 互操作接口,两者均有 javadoc。与 Luje 不同,它侧重 OC 与 Lua 互操作特性。JVM 本身独立于命令行程序,适合想在 OC 环境运行 Java 软件的开发者。
日本語 Lukyt は Lua で書かれた小型 JVM で、Java 6 をサポートします。主な目的は OpenComputers モッド上で Java プログラムを動かすことです。OCJ と共通の OpenComputers Java API を提供するため、両方の実行方式でプログラムに互換性があります。Lua との相互運用機能も備え、いずれも javadoc が公開されています。Luje と異なり OC と Lua の連携を重視しており、OC 上で Java ソフトを動かしたい開発者向けです。
한국어 Lukyt는 Lua로 작성된 소형 JVM으로 Java 6을 지원합니다. 주된 목적은 OpenComputers 모드에서 Java 프로그램을 실행하는 것입니다. OCJ와 공유하는 OpenComputers Java API를 제공해 두 실행 방식에서 프로그램 호환성을 유지하며, Lua 상호운용 인터페이스도 갖추고 각각 javadoc이 공개되어 있습니다. Luje와 달리 OC 및 Lua 연동에 중점을 두며, OC 환경에서 Java 소프트웨어를 실행하려는 개발자에게 적합합니다.
English Lukyt is a small JVM written in Lua that supports Java 6. Its main purpose is running Java programs inside the OpenComputers mod. It provides an OpenComputers Java API shared with OCJ, so programs stay compatible across both ways of running Java on OC, and it includes a Lua interop layer; both have javadoc. Unlike Luje, it focuses on OC and Lua interoperability. It suits developers who want to run Java software on OpenComputers.
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.
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");
}
}