Hi I'm trying to create a .jar file to include in Jmeter. Can I create a Jar where the code is written in Javascripts.
Asked
Active
Viewed 4,367 times
1
-
I guess you can do this. Follow this link http://stackoverflow.com/questions/11745501/use-maven-to-pack-javascript-files-in-jar – log N Aug 12 '13 at 05:48
1 Answers
2
Technically, yes, you could, but it would require you to use a JVM Javascript engine like Rhino or Nashorn (supposed to be officially ready at the end of 2013). The running code in jars is contained in .class
files, which are the executable "machine code" for the JVM. The most common language to write these in is Java, but many other languages can be compiled into .class
files.
Javascript has essentially nothing to do with Java, and while you can use a program that runs on the JVM to run Javascript, I don't think it's quite what you have in mind. This Javascript looks basically like Java with the quirky Javascript syntax, and you still need to be familiar with the Java APIs that you're wanting to use.

chrylis -cautiouslyoptimistic-
- 75,269
- 21
- 115
- 152