Is there any JavaScript jvm implementations?
If no, can you give me some reasons why it hasn't realized already? (not possible probably?) I'm trying to understand what is absent to create one?
Reason why i'm asking is that i want to create web browser ide with compile functionality without even having jdk or jre installed on the computer(just in browser).
Embedded Script Engine The second and probably more common way to run JavaScript from within the JVM is via the ScriptEngine. JSR-223 defines a set of scripting APIs, allowing for a pluggable script engine architecture that can be used for any dynamic language (provided it has a JVM implementation, of course).
Implement. js is a library that attempts to bring interfaces to JavaScript. The idea is simple: define an interface, define the types of it's properties, and use it to ensure an object is what you expect it to be.
You can call JavaScript from Java using the Java Scripting Framework, but in this case, it's probably easiest to just translate your colleague's code to Java. It's not really long, is it? Java has a 'scripting engine' for evaluating for example JavaScript from Java.
The JDK is a key platform component for building Java applications. At its heart is the Java compiler. IDG / Oracle / Vasabii / Getty Images. The Java Development Kit (JDK) is one of three core technology packages used in Java programming, along with the JVM (Java Virtual Machine) and the JRE (Java Runtime Environment) ...
Most current one seems to be Doppio
You may have a look at the bck2brwsr (aka java.net HTML)
The scope of the project is not to execute any existing java library. (see http://wiki.apidesign.org/wiki/Bck2Brwsr)
There are two nice examples on the web:
To get started with a working example (needs Maven and JDK7):
Step 1: load archetype
mvn archetype:generate -DarchetypeGroupId=org.apidesign.bck2brwsr \
-DarchetypeArtifactId=bck2brwsr-archetype-html-sample -DarchetypeVersion=0.7.2 \
-DarchetypeRepository=https://maven.java.net/content/repositories/releases/
Step 2: build HTML page and dependencies and pack as ZIP file
mvn install
# produces bck-1.0-SNAPSHOT-bck2brwsr.zip
Step 3: unpack ZIP
cd target; unzip bck-1.0-SNAPSHOT-bck2brwsr.zip
creating: public_html/
creating: public_html/lib/
extracting: public_html/lib/emul-0.7.2-rt.jar
extracting: public_html/lib/javaquery.api-0.7.2.jar
inflating: public_html/bck2brwsr.js
extracting: public_html/bck-1.0-SNAPSHOT.jar
inflating: public_html/index.html
Step 4: open index.html with your browser
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With