How can I use JavaScript in Java? [closed]

Rhino is what you are looking for.

Rhino is an open-source implementation of JavaScript written entirely
in Java. It is typically embedded into Java applications to provide
scripting to end users.

Update: Now Nashorn, which is more performant JavaScript Engine for Java, is available with jdk8.

Update 2022: Nashorn was deprecated in Java 11, then eventually removed in Java 15.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)