Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ant <script> problem

Status
Not open for further replies.

feseto

Technical User
Dec 1, 2004
1
GB
Trying to write to a file using the <script> tag. The following snippet executes but my resultant output file is blank.

Everything config-wise for running script is set up correctly (js.jar et al)...


<project name="MyProject" basedir="." default="main">
<target name="main">
<script language="javascript"> <![CDATA[

importPackage(java.io);
var outfile = new PrintWriter(new FileWriter("test.txt"));

outfile.println("Testing1");
outfile.println("Testing2");
outfile.close;

]]></script>
</target>
</project>


Anyone any idea? Much appreciated.
Alex Feseto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top