• Post Reply Bookmark Topic Watch Topic
  • New Topic

Using JVM for JavaScript  RSS feed

 
Prash Singh
Ranch Hand
Posts: 103
jQuery Netbeans IDE Notepad
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

The JVM is capable of running multiple languages including Java Script. I am confused , what could be the possible cases in which one would use the Java script to be executed on the JVM.
Please explain.

Thanks in advance.


 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can do with it whatever you want to do with it. For example, you can integrate a scripting engine into your own application to make it possible for users to automate things in your application.

Last year I worked on a project where we wrote a piece of software that does price calculations (batch processing: it reads transactions from a file, and then calculates the price of each, according to business rules). We needed to have a way to be able to change things in the business rules easily, without needing to create a new version of the application each time a business rule changes. So we added the possibility to implement business rules in JavaScript; our application uses the JVM scripting engine to execute those scripts.

JavaScript is also sometimes used on the server side in web applications (have a look at Node.js, for example, which allows you to build webapps in JavaScript - although Node.js does not run on the JVM).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!