Reference javax.script.ScriptEngine in android or evaluate a javascript expression

后端 未结 4 944
南方客
南方客 2020-11-30 13:02

Is it possible to reference the javax.script.ScriptEngine library when developing an android application? If not is there anyway possible to evaluate a javascript expression

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-30 13:28

    According to this post, javax.script.ScriptEngine is not available in Android SDK. You can try the steps below to include the library, but the code may not run, even though it will compile.

    Using Android Development Toolkit in Windows, I performed the following steps to get javax.script library.

    1. Right-clicked on the project, went to Properties (Project).
    2. Under the Java Build Path, I chose Libraries tab.
    3. Select Add Library located on the middle right of the Tab
    4. Select JRE System Library under Add Library and click Next...
    5. Select Workspace Default JRE (jre 7)
    6. Click Finish.
    7. Click Ok on the Java Build Path to exist project properties.

    Javax.script was then loaded.

提交回复
热议问题