Skip to main content

Questions tagged [java-scripting-engine]

The tag has no usage guidance.

java-scripting-engine
0 votes
1 answer
167 views

Can not call javascript rosnode module from java

I am trying to create a web application(in java) that can communicate with a ros server. Therefore I use the rosnode module. For the website I use vaadin. My problem is that I do not know how to call/...
CoderOfTheForce's user avatar
2 votes
0 answers
400 views

Running Kotlin Scripts (.kts) with bindings from IntelliJ - unresolved reference: bindings

I am trying to run .kts scripts (using Script Engine) from a Kotlin program. The Kotlin scripts reside in the resource folder of the project and normally they have support for auto-completion, IDE ...
Andrei Ciobanu's user avatar
1 vote
0 answers
244 views

Using pandas and other libraries with Java's ScriptEngine

I'm running Python through Java's Scripting Engine. The basic hello world is working well, but it fails when I import pandas in the python script. StringWriter stringWriter = new StringWriter(); ...
Palak Bansal's user avatar
0 votes
1 answer
789 views

How in Java do I inject code during execution time?

I'm working on a java spring app which I need to provide the ability to add new code without altering standard code. My challenges: Store "custom" code in a database Inject code at execution time ...
felix53's user avatar
  • 41
2 votes
1 answer
300 views

String expression interpolation support in java scripting engines

I'm using groovy/nashorn as java engine but not able to interpolate Strings. jdk.nashorn.api.scripting.NashornScriptEngine scriptEngine =(NashornScriptEngine) factory.getEngineByName("nashorn"); ...
Zizou's user avatar
  • 923
-2 votes
1 answer
95 views

Is there a way to run consecutive commands in python from Java? [duplicate]

What I want to do is, I have a semantic parser written in Java, and this semantic parser will output one-liner code in Python (string). And I want to make this consecutively. Methods I searched are ...
anton-sturluson's user avatar
1 vote
1 answer
239 views

How to get OSGiScriptEngineManager running

I'm not quite a total newbie to OSGi, but apparently newbie enough. What I want to do is write an OSGi (Apache Felix) bundle and use the Java scripting API (JSR-223) with for example Groovy. For ...
tbeernot's user avatar
  • 2,574
5 votes
1 answer
1k views

Nashorn: JavaScript expression evaluation throws class cast exception for function exposed using lambda

I have a following class with one variable of type Long package com.nm.poc; public class JSLong{ private Long longValue; public Long getLongValue() { return longValue; } public void ...
Nitesh's user avatar
  • 97
0 votes
1 answer
971 views

If I bind an object of one of my classes to a scripting engine, how can I access it as an object of that class from withing the scripting engine?

I want to be able to pass an object into ScriptEngine via put() and be able to access its properties and methods from within the scripting engine. e.g public class MyClass { String getName() { ...
ycomp's user avatar
  • 8,526
30 votes
4 answers
65k views

How can I determine if a variable exists from within the Groovy code running in the Scripting Engine?

How can I determine if a variable exists from within the Groovy code running in the Scripting Engine? The variable was put by ScriptEngine's put method
ycomp's user avatar
  • 8,526
0 votes
1 answer
388 views

Calling java script files synchronously failing in Microsoft Edge browser.

I have abc.html page in which i am calling two javascript files as below in the head tag:- <head> <script src="script_files/1.js"></script> <script src="script_files/2.js">...
Vinay's user avatar
  • 725
1 vote
2 answers
3k views

ScriptEngine with name "nashorn" is null

I'm trying to create ScriptEngine with name "nashorn": ScriptEngineManager manager = new ScriptEngineManager(); ScriptEngine engine = manager.getEngineByName("nashorn"); if (engine == null) { ...
Ksenia's user avatar
  • 3,683
0 votes
1 answer
454 views

Manipulating HTML nodes with java javascript scripting API

I'm using the Java Scripting API which is working quite well. Now I have a function where I want to get all <a> tags from a String and then add/remove attributes before returning the ...
msp's user avatar
  • 3,334
1 vote
1 answer
1k views

Rhino: Ability to pause, save state and resume javascript

I'm using Rhino to interpret javascripts by Java. My use case requires these javascripts making (multiple) service calls (RESTful/Webservices/HTTP GET/POST). Some of these service calls are async in ...
ankitn's user avatar
  • 71