Fast, reliabe & crossplatform Javascript API/Library for Java? (for game dev.)

Hello dear JGO :slight_smile:

I looked all over the net, and information seems to be really sparse, or just a very short snipped without a serious explanation.
Usually people point to Oracle’s Rhino or Nashorn. Rhino is ‘old’ and slow, and Nashorn is pretty much brand new as i understand.

I need an API/Library that is fast, reliable, crossplatform and is easily embedabble withing java.(i.e easy to call functions from one to the other etc)

Also, if anyone could tell me if it is a good idea to develop with the latest Java version in LWJGL.
I generally don’t think i should use the cutting edge JDK’s since it will probably cause more bad than good, but i don’t know.
The need to use the latest oracle JDK also makes me want to stay away from Nashorn.

And yes, it really, really needs to be JavaScript :stuck_out_tongue:

Edit: My problem at hand needs reformulation. Here is what i need JavaScript for initially but not exclusively.

I need Javascript to process entites of my EntityComponentSystem.
By that i mean(Pseudoish-code):


for(int i = 0; i < EntityAmount; i++){
     Entity entity = World.get(i);

     ScriptEngine.eval(entity, world);
}

I want to attach a specific script to an entity, and let the script to the work instead of hardcoding.

Thank you very much in advance, your helpt is greatly appreciated!