Script Engine in Service

I want to run JavaScript code using Script Engine. I found a project called Rhino-android, and I got the desired result when I clicked the button in Activity. However, when I implemented it to work in Service, it came out that there is no Script Engine Factory. Can you help me with this?

implement Project.

    implementation 'com.sun.phobos:jsr223-api:1.0'
    implementation 'io.apisense:rhino-android:1.0'
    implementation group: 'org.mozilla', name: 'rhino', version: '1.7.13'
   ScriptEngineManager manager = new ScriptEngineManager();
   Log.d(TAG, "manager = " + manager);
   List<ScriptEngineFactory> list = manager.getEngineFactories();
   Log.d(TAG, "list = " + list);
   for (ScriptEngineFactory factory: list){
      Log.i(TAG, "factory = " + factory.getEngineName() + ", engines = " + factory.getNames());
   }