![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
java2js can translate simple Java programs to JavaScript and runs them using a JavaScript based JDK.
Try it out! The demo files are located in the docs folder of this repository, its a barebones implementation that shows what is possible with java2js.
java.io | ||
---|---|---|
File | InputStream | PrintStream |
java.lang | ||
---|---|---|
Boolean | Byte | Character |
Double | Exception | Float |
Integer | Long | Short |
String | StringBuilder | System |
Thread | Throwable |
java.security |
---|
MessageDigest |
java.time |
---|
Instant |
java.util | ||
---|---|---|
AbstractCollection | AbstractList | AbstractMap |
AbstractSet | ArrayList | Arrays |
Collections | Formatter | HashMap |
HashSet | IllegalFormatException | Itr |
LinkedList | Random | Scanner |
Set | Stack |
The java2js transpiler supports:
This function imports the standard java.lang classes into the global scope. You must use it before translating or running files.
./jdk
(the java2js JS JDK), for online use on codepen or similar code sharing sites you can use this link as the root path: 'https://quinton-ashley.github.io/java2js/jdk'Translates a Java class and loads it.
returns a String with the JavaScript transpilation of the Java class
Runs the main method
not very good error reporting
no support for method overloading, though a workaround might be possible by making a function with the og name route to each of the variations of the overloaded function
no support for private/public methods yet, though this could be done since they are included in modern JavaScript classes
no three dimensional arrays
no third level static classes
no method can be named .length()
because it will be replaced with .length
for getting the length of Strings in JS
I created this package so intro level computer science students could write Java code but still use my QuintOS retro game engine library, which is web based.
This project builds upon the java-to-javascript transpiler by @wyattades. I also did a modern JS implementation of the fundamental classes in the JDK (Java Development Kit), which I got the inspiration to do from java2javascript by @BobHanson, @zhourenjian, @abego, and others.
I've only done a partial implementation of the Java 17 JDK in JavaScript, so if you're interested in adding more please go for it and submit a pull request!
This project is licensed under the copyleft GNU GENERAL PUBLIC LICENSE 3.0 (only) license. If you'd like to request legal permission to use this code in a commerical product or closed source project please email me (qashto@gmail.com) with a proposal of how you would like to use java2js
.
FAQs
Converts Java to JavaScript and runs it with a JS JDK
The npm package java2js receives a total of 0 weekly downloads. As such, java2js popularity was classified as not popular.
We found that java2js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.