Ant installation and ant environment configuration

Source: Internet
Author: User
1. Ant installation and ant environment configuration

2, ' mode ', ' Explorer ' is not an internal or external command, nor a running program or batch file. Workaround.

3, java.lang.OutOfMemoryError:requested 487424 bytes for the card table Expans solution.

Install the JDK first, then configure your ant environment:

1, ant installation file download. Click here to download the zipped or http://ant.apache.org/bindownload.cgi download Zip package apache-ant-1.8.2-bin.zip.

2, decompression package. such as decompression to E:\ learning class \apache-ant-1.8.2,

3, configure environment variables. Create a new Ant_home variable in the system environment variable, the value is E:\ learning class \apache-ant-1.8.2.  Add%ant_home%\bin to the path variable; If there is no path variable, the new one is created.

4, verify the ant environment configuration. Start--> run--> input cmd, open the DOS command window. Finally, at the command line, enter: Ant-version, if the version number is displayed, it represents the success of the ant environment configuration. Ant-help can view help information.

Issues that occurred while compiling the project:

1,

' Mode ' is not an internal or external command, it is not a running program or a batch file.
' Explorer ' is not an internal or external command, nor a running program or batch file.
Modify the path value in the environment variable, plus%systemroot%\system32;%systemroot%;%systemroot%\system32\wbem at the front

2,
java.lang.OutOfMemoryError:requested 487424 bytes for card table Expans

Workaround 1:
<target name= "Compile" depends= "init" >
<javac srcdir= "${src}" destdir= "${dest}" debug= "true" fork= "true" memorymaximumsize= "512m" >
<classpath refid= "Project.class.path"/>
<classpath refid= "Jspc.class.path"/>
</javac>
</target>

Add fork= "true" memorymaximumsize= "512m" to the JAVAC option to add the memory at compile time

Workaround 2:
New java_opts in environment variable, value:-xms64m-xmx512

Workaround 3:
If you are using Eclipse development, when you build a Web project with Ant, you encounter Java.lang.OutOfMemoryError:Java heap space anomaly
window->preferences->java->installed Jres->edit JRE
Set the default VM arguments parameter to-xms64m-xmx512

Workaround 2 is a generic method, whether it is compiled directly with Ant or in eclipse.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.