1
0
mirror of https://github.com/quinton-ashley/java2js synced 2024-12-29 10:11:54 +01:00
This commit is contained in:
Quinton Ashley 2022-02-21 11:11:18 -05:00
parent 7e855616c8
commit e11bf077f8
5 changed files with 8 additions and 7 deletions

View File

@ -2,7 +2,7 @@
`java2js` can translate simple Java programs to JavaScript and runs them using a JavaScript based JDK. `java2js` can translate simple Java programs to JavaScript and runs them using a JavaScript based JDK.
Try out the `demo.html` and `ide.js`, a barebones implementation. Try out the demo in the docs folder of this repository. `index.html` and `ide.js` are a barebones implementation.
## Java classes included in the java2js JDK ## Java classes included in the java2js JDK
@ -46,7 +46,7 @@ The java2js transpiler supports:
- arrays with initial size - arrays with initial size
- two dimensional arrays - two dimensional arrays
- lambda arrow functions - lambda arrow functions
- triple quotes - triple quote strings
## API ## API

BIN
docs/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -1,6 +1,6 @@
(async () => { (async () => {
jdk.log = document.getElementById('javaConsole'); jdk.log = document.getElementById('javaConsole');
await jdk.init(); await jdk.init('..');
let file0 = document.getElementById('javaFile'); let file0 = document.getElementById('javaFile');
file0.onchange = async () => { file0.onchange = async () => {

View File

@ -2,6 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<link rel="icon" type="image/x-icon" href="./favicon.ico" />
<title>java2js test</title> <title>java2js test</title>
<style> <style>
body, body,
@ -47,7 +48,7 @@
placeholder="Java console, click here to run!" placeholder="Java console, click here to run!"
></textarea> ></textarea>
<script type="text/javascript" src="jdk.js"></script> <script type="text/javascript" src="../jdk.js"></script>
<script type="text/javascript" src="ide.js"></script> <script type="text/javascript" src="ide.js"></script>
</body> </body>
</html> </html>

View File

@ -1,11 +1,11 @@
{ {
"name": "java2js", "name": "java2js",
"version": "1.1.10", "version": "1.1.11",
"description": "Converts Java to JavaScript with support for p5.js and QuintOS.", "description": "Converts Java to JavaScript and runs it with a JS JDK",
"main": "jdk.js", "main": "jdk.js",
"scripts": { "scripts": {
"start": "open demo.html", "start": "open demo.html",
"test": "echo \"Error: no test specified\" && exit 1", "test": "open demo.html",
"v": "npm version patch --force", "v": "npm version patch --force",
"V": "npm version minor --force", "V": "npm version minor --force",
"version": "git add -A", "version": "git add -A",