-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
javax.script.ScriptEngine 8 11 15 17
- Loading branch information
Showing
6 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import javax.script.ScriptEngineManager; | ||
import javax.script.ScriptEngineFactory; | ||
|
||
public class Test{ | ||
public static void main(String[] args){ | ||
// ScriptEngine engine = new ScriptEngineManager().getEngineByName("Nashorn"); | ||
// System.out.println(engine); | ||
java.util.List<ScriptEngineFactory> eF = new ScriptEngineManager().getEngineFactories(); | ||
System.out.println(eF.size()); | ||
eF.forEach(f -> System.out.println(String.format("[%s] [%s]", f.getEngineName(), f.getClass()))); | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
BUILD_JDK='11.0.14.10.1-amzn' | ||
RUN_JDK='17.0.2.8.1-amzn' | ||
|
||
sdk use java $BUILD_JDK && javac Test.java | ||
sdk use java $RUN_JDK && java -cp nashorn-core-15.4.jar:asm-9.1.jar:. Test | ||
|
||
# eg | ||
# sdk use java 11.0.14.10.1-amzn && javac Test.java | ||
# sdk use java 17.0.2.8.1-amzn && java -cp nashorn-core-15.4.jar:asm-9.1.jar:. Test |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
sdk () { | ||
COMMAND="$1" | ||
QUALIFIER="$2" | ||
case "$COMMAND" in | ||
(l) COMMAND="list" ;; | ||
(ls) COMMAND="list" ;; | ||
(v) COMMAND="version" ;; | ||
(u) COMMAND="use" ;; | ||
(i) COMMAND="install" ;; | ||
(rm) COMMAND="uninstall" ;; | ||
(c) COMMAND="current" ;; | ||
(ug) COMMAND="upgrade" ;; | ||
(d) COMMAND="default" ;; | ||
(h) COMMAND="home" ;; | ||
(e) COMMAND="env" ;; | ||
esac | ||
if [[ "$COMMAND" != "update" ]] | ||
then | ||
___sdkman_check_candidates_cache "$SDKMAN_CANDIDATES_CACHE" || return 1 | ||
fi | ||
SDKMAN_AVAILABLE="true" | ||
if [ -z "$SDKMAN_OFFLINE_MODE" ] | ||
then | ||
SDKMAN_OFFLINE_MODE="false" | ||
fi | ||
__sdkman_update_service_availability | ||
if [ -f "${SDKMAN_DIR}/etc/config" ] | ||
then | ||
source "${SDKMAN_DIR}/etc/config" | ||
fi | ||
if [[ -z "$COMMAND" ]] | ||
then | ||
___sdkman_help | ||
return 1 | ||
fi | ||
CMD_FOUND="" | ||
if [[ "$COMMAND" != "selfupdate" || "$sdkman_selfupdate_feature" == "true" ]] | ||
then | ||
CMD_TARGET="${SDKMAN_DIR}/src/sdkman-${COMMAND}.sh" | ||
if [[ -f "$CMD_TARGET" ]] | ||
then | ||
CMD_FOUND="$CMD_TARGET" | ||
fi | ||
fi | ||
CMD_TARGET="${SDKMAN_DIR}/ext/sdkman-${COMMAND}.sh" | ||
if [[ -f "$CMD_TARGET" ]] | ||
then | ||
CMD_FOUND="$CMD_TARGET" | ||
fi | ||
if [[ -z "$CMD_FOUND" ]] | ||
then | ||
echo "" | ||
__sdkman_echo_red "Invalid command: $COMMAND" | ||
echo "" | ||
___sdkman_help | ||
fi | ||
if [[ -n "$QUALIFIER" && "$COMMAND" != "help" && "$COMMAND" != "offline" && "$COMMAND" != "flush" && "$COMMAND" != "selfupdate" && "$COMMAND" != "env" && "$COMMAND" != "completion" && "$COMMAND" != "edit" && "$COMMAND" != "home" && -z $(echo ${SDKMAN_CANDIDATES[@]} | grep -w "$QUALIFIER") ]] | ||
then | ||
echo "" | ||
__sdkman_echo_red "Stop! $QUALIFIER is not a valid candidate." | ||
return 1 | ||
fi | ||
if [[ "$COMMAND" == "offline" && -n "$QUALIFIER" && -z $(echo "enable disable" | grep -w "$QUALIFIER") ]] | ||
then | ||
echo "" | ||
__sdkman_echo_red "Stop! $QUALIFIER is not a valid offline mode." | ||
fi | ||
local final_rc=0 | ||
local native_command="${SDKMAN_DIR}/libexec/${COMMAND}" | ||
if [ -f "$native_command" ] | ||
then | ||
"$native_command" "${@:2}" | ||
elif [ -n "$CMD_FOUND" ] | ||
then | ||
local converted_command_name=$(echo "$COMMAND" | tr '-' '_') | ||
__sdk_"$converted_command_name" "${@:2}" | ||
fi | ||
final_rc=$? | ||
return $final_rc | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
java -cp nashorn-core-15.4.jar:asm-9.1.jar:. Test |