Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the reason behind to include a engine in Java to run JavaScript?

To let JavaScript able to run in server-side?

If it's justified, what's the advantage? and any good application for such use?

like image 485
developer.cyrus Avatar asked May 06 '26 02:05

developer.cyrus


1 Answers

There are lots of possible reasons. Here's a blog post by Steve Yegge (of Google) explaining why he was looking into using Mozilla Rhino (which later because javax.script).

According to the Rhino site:

It is typically embedded into Java applications to provide scripting to end users.

So I guess that's one good reason. Other things I've read include doing it because you have some complex language that you want to run on either the browser or the server, and you don't want to write it twice (as here).

Generally speaking, that's a lot of complexity, and generally speaking, complexity is bad.

like image 149
Ian Varley Avatar answered May 07 '26 17:05

Ian Varley



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!