fix detecting script engine.
fix failure on JDK8.
add "deprecated".