ReferenceError:未在<eval>的第3行

时间:2019-01-19 09:00:53

标签: java

有人可以告诉我为什么下面的代码引发ReferenceError:在第3行没有定义“ ActiveXObject”吗?

` ScriptEngineManager manager = new ScriptEngineManager();

    ScriptEngine engine = manager.getEngineByName("javascript");


    FileInputStream fileInputStream = new FileInputStream("D:\\test.js");
          if (fileInputStream != null)
    {
                    BufferedReader reader = new BufferedReader(new InputStreamReader(fileInputStream));
                    engine.eval(reader);

         Invocable invocableEngine = (Invocable)engine;
         Object object = invocableEngine.invokeFunction("myExport");
    }

`

test.js

function myExport(){

var myOb = new ActiveXObject(“ MyApp.Application”);

......

0 个答案:

没有答案