For the “script” task, more details can be described.
From the “script“ task description we can know that after Ant 1.7 the “script” task can be used with either “BSF” or “JSR223“. “JSR223” was embedded in JDK after JDK6. So After JDK6, ant 1.7 or later version can use the “script” task without any other dependencies.
And also, if you want to know what scripting languages are supported by your current JDK, please run the following Java class:
1. For "IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Linux x86-32 jvmxi3260sr9-20110624_85526 (JIT enabled, AOT enabled)":
Engine name is: Mozilla Rhino Engine version is: 1.6 release 2 Engine extensions are: [js] Language name is: ECMAScript Language version is: 1.6 Mime Types are: [application/javascript, application/ecmascript, text/javascript, text/ecmascript] Name are: [js, rhino, JavaScript, javascript, ECMAScript, ecmascript]
2. For "Java(TM) SE Runtime Environment (build 1.6.0_30-b12)":
Engine name is: Mozilla Rhino Engine version is: 1.6 release 2 Engine extensions are: [js] Language name is: ECMAScript Language version is: 1.6 Mime Types are: [application/javascript, application/ecmascript, text/javascript, text/ecmascript] Name are: [js, rhino, JavaScript, javascript, ECMAScript, ecmascript]
3. For "Java(TM) SE Runtime Environment (build 1.7.0_01-b08)":
Engine name is: Mozilla Rhino Engine version is: 1.7 release 3 PRERELEASE Engine extensions are: [js] Language name is: ECMAScript Language version is: 1.8 Mime Types are: [application/javascript, application/ecmascript, text/javascript, text/ecmascript] Name are: [js, rhino, JavaScript, javascript, ECMAScript, ecmascript]
So it seems “Mozilla Rihno” is the only script language supported by JDK scripting by default. Any other scripting language wanted to be used using JDK scripting support should have some more configuration.