简体   繁体   中英

Why aren't javax.script classes recognized by Java15?

I am trying to import scrip engine related classes and using Java 15 oracle standard on windows 10 in eclipse.

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;

Compiler says - "The type javax.script.ScriptEngineManager is not accessible"

Looks like you're using Eclipse.

If you place the cursor on the red-underlined text and press Ctrl+1 (Quick Fix), or right-click and select "Quick Fix", you get a pop-up menu like this:

弹出菜单

Select the menu item highlighted here to add the missing requires statement to the module-info.java file.

It doesn't matter which of the 3 lines you do this on.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM