R
R
Riard Brugekaaim2017-02-02 12:26:29
Java
Riard Brugekaaim, 2017-02-02 12:26:29

Scripts in Java. How can a script be executed in a restricted environment?

The issue is more debatable.
I have an application that uses Lua scripts and I have 2 questions.

  1. And what other scripting languages ​​that can be embedded in a Java application support an arbitrary environment (only the set of function objects, etc. that you define yourself) is available in the body of the script?
  2. And which one from this list works faster?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Rou1997, 2017-02-02
@Rou1997

And what scripting languages ​​that can be embedded in a Java application support an arbitrary environment (only the set of function objects, etc., that you define yourself) is available in the body of the script?

First of all, of course, JavaScript - there is the Mozilla Rhino "engine", it is in Java, I personally work with it on Android, there is a limited, arbitrary environment, also Python, the same Lua, but probably any open one can somehow " screw", including Java itself, but you need a JDK to compile it, I don't know how to do it on Android.
There were no complaints about the performance of Rhino, it does not have such general problems, such as the script just displays "hello world" and it already takes five seconds, but about large calculations, etc., this is already specific.

A
aol-nnov, 2017-02-02
@aol-nnov

in java, you can execute code in java :) through binshell. Just a limited environment.

M
Max, 2017-02-02
@Maxon4eg92

there is a jython python interpreter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question