Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Warning: node.js detection failed, sbt will use the Rhino based Trireme JavaScript engine

I'm new to Play framework. Please explain the meaning of the below warning.

Warning: node.js detection failed, sbt will use the Rhino based Trireme JavaScript engine instead to run JavaScript assets compilation, which in some cases may be orders of magnitude slower than using node.js

I don't want anything that slow down my application so please advice if I should change the JS Engine to Node.js, but my PlayFramework project is using Java on the server side.

like image 233
sij Avatar asked Jul 18 '15 14:07

sij


3 Answers

You need to install Node.js and then tell the sbt/java engine to use it.

  brew install node

Edit .bash_profile and add:

   export SBT_OPTS="${SBT_OPTS} -Dsbt.jse.engineType=Node -Dsbt.jse.command=$(which node)"

This eliminated the warning for me on OSX

like image 108
ski_squaw Avatar answered Nov 15 '22 14:11

ski_squaw


In Windows:

  • Install node.js
  • Go to Control Panel - System and Security - System - Advanced system settings
  • Click Environment Variables...
  • Search in System variables for SBT_OPTS
    • If such exists, click Edit... and concatenate -Dsbt.jse.engineType=Node to Variable value
    • If such does NOT exist, click New... and write SBT_OPTS to Variable name and -Dsbt.jse.engineType=Node to Variable value
  • Click OK - OK - OK
  • Restart any command prompt (cmd, PowerShell) that is currently running Play Framework
like image 22
Stefan Georgiev Avatar answered Nov 15 '22 12:11

Stefan Georgiev


in ubuntu

curl -sL https://deb.nodesource.com/setup | sudo bash -

sudo apt-get install -y nodejs

then add as above to your .profile in your home directory

export SBT_OPTS="${SBT_OPTS} -Dsbt.jse.engineType=Node -Dsbt.jse.command=$(which node)"

then

 . ./.profile 

to reload your .profile

For a more flexible install using node version manager check the following tutorial: how to install node js on an ubuntu 14.04 server

Build again and the warning about using the Trireme stuff should be gone.

like image 21
Slayer6 Avatar answered Nov 15 '22 14:11

Slayer6