There is an independent way, like we do in java:
Desktop.getDesktop.open(new File("file.html")) ?
I see no exit without ant optional tasks. From all the scripts beanshell looks most lightweight and does not require any new knowledge. So I did it this way:
<property name="bshJar" value="
C:\lang\java\bsh-1.3.0.jar:
C:\lang\java\bsf.jar:
C:\lang\java\commons-logging-1.1.1.jar" />
<script manager="bsf" language="beanshell" classpath="${bshJar}">
java.awt.Desktop.getDesktop().open(
new java.io.File("c:\\temp\\1\\stackoverflow\\DVD FAQ.htm"));
</script>
And this is an answer about getting script
task running. However javascript
language is indeed a better option, as it needs no classpath
(and no manager
) in JDK 6. And the code inside remains the same.