⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch01s05.html

📁 详细介绍了jboss3.0的配置等
💻 HTML
字号:
<html><head>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Installing Ant</title><link rel="stylesheet" href="styles.css" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/styles.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets Vimages/callouts/"><link rel="home" href="index.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/index.html" title="JBoss 3.0 Documentation"><link rel="up" href="ch01.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch01.html" title="Chapter 1. First steps"><link rel="previous" href="ch01.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch01.html" title="Chapter 1. First steps"><link rel="next" href="ch01s06.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch01s06.html" title="Installing JBoss"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="0" cellpadding="0" cellspacing="0" height="65"><tr height="65"><td rowspan="2"><img src="jboss.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/jboss.gif" border="0"></td><td rowspan="2" background="gbar.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/gbar.gif" width="100%" align="right" valign="top"><a href="index.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/index.html"><img src="doc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/doc.gif" border="0"></a><a href="ch01.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch01.html"><img src="toc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/toc.gif" border="0"></a><a href="ch01.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch01.html"><img src="prev.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/prev.gif" border="0"></a><a href="ch01s06.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch01s06.html"><img src="next.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/next.gif" border="0"></a></td></tr><tr></tr></table><div class="section"><a name="intro.install.Ant"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="intro.install.Ant"></a>Installing Ant</h2></div></div><p>You need Ant to compile and run the example presented in the JBoss documentation. Ant is
the standard build tool used by most open source Java projects and is widely being used in commercial
settings as well. You need Ant version 1.4 or latter. You can download the 1.4 binaries for Ant from <a href="javascript:if(confirm('http://jakarta.apache.org/builds/jakarta-ant/release/v1.4/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://jakarta.apache.org/builds/jakarta-ant/release/v1.4/'" tppabs="http://jakarta.apache.org/builds/jakarta-ant/release/v1.4/" target="_top">this link to the Apache/Jakarta website</a>. If you have problems finding
binaries at that location try the Ant home page which is located <a href="javascript:if(confirm('http://jakarta.apache.org/ant/index.html  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://jakarta.apache.org/ant/index.html'" tppabs="http://jakarta.apache.org/ant/index.html" target="_top">on the Apache/Jakarta website</a>.</p><p>Once you have the Ant distribution unarchive it to create a jakarta-ant-1.4 directory.  The Ant documentation
is located in the docs/manual directory. You should start with the docs/manual/index.html file and browse through its
contents if you want to use Ant. You won't need to know anything about Ant build scripts in order to compile and run
the examples in the JBoss documentation. All we care about at this point is that you have Ant installed and availble
in your executation path such that you can run ant from the command line. To do this you need the path to the jakarta-ant-1.4/bin
directory in your PATH environment variable(or the equivalent construct for you OS). So for example, I have Ant installed
in /usr/local/Java/Ant/jakarta-ant-1.4 and my PATH contains /usr/local/Java/Ant/jakarta-ant-1.4/bin. On a win32 platform
with Ant installed in G:/tmp/jakarta-ant-1.4 you would need G:/tmp/jakarta-ant-1.4/bin in your PATH. Setup your
PATH now.</p><p>You need the bin directory of a 1.3 JDK(Java development kit) in your path as well for access to the
java interpreter and java compiler. You also typically need to set the JAVA_HOME environment variable to point to
the location of a JDK 1.3 installation so that Ant can find the javac compiler. Your Ant installation may have been
configured such that this is not necessary and you can try the following installation test without this set at first.</p><p> Test the Ant installation by opening a shell or command prompt. Next create a build.xml file in the
current directory that contains the contents listed in the following figure:<div class="figure"><p><a name="d0e177"></a><b>Figure 1.1. Ant build.xml script for testing an Ant installation</b></p><div class="literallayout"><br>
&lt;!--&nbsp;Simple&nbsp;Ant&nbsp;build&nbsp;script&nbsp;to&nbsp;test&nbsp;an&nbsp;Ant&nbsp;installation&nbsp;--&gt;<br>
&lt;project&nbsp;name="TestInstall"&nbsp;default="run"&nbsp;basedir="."&gt;<br>
<br>
&nbsp;&nbsp;&lt;target&nbsp;name="init"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;available&nbsp;file="ASimpleHelloObject.java"&nbsp;property="ASimpleHelloObject"/&gt;<br>
&nbsp;&nbsp;&lt;/target&gt;<br>
<br>
&nbsp;&nbsp;&lt;target&nbsp;name="ASimpleHelloObject"&nbsp;unless="ASimpleHelloObject"&nbsp;depends="init"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;echo&nbsp;file="ASimpleHelloObject.java"&gt;<br>
public&nbsp;class&nbsp;ASimpleHelloObject<br>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;static&nbsp;void&nbsp;main(String[]&nbsp;args)<br>
&nbsp;&nbsp;&nbsp;&nbsp;{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("ASimpleHelloObject.main&nbsp;was&nbsp;called");<br>
&nbsp;&nbsp;&nbsp;&nbsp;}<br>
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/echo&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;echo&nbsp;message="Wrote&nbsp;ASimpleHelloObject.java"&nbsp;/&gt;<br>
&nbsp;&nbsp;&lt;/target&gt;<br>
<br>
&nbsp;&nbsp;&lt;target&nbsp;name="compile"&nbsp;depends="ASimpleHelloObject"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;javac&nbsp;destdir="."&nbsp;srcdir="."&nbsp;debug="on"&nbsp;classpath="."&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;include&nbsp;name="ASimpleHelloObject.java"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/javac&gt;<br>
&nbsp;&nbsp;&lt;/target&gt;<br>
<br>
&nbsp;&nbsp;&lt;target&nbsp;name="run"&nbsp;depends="compile"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;java&nbsp;classname="ASimpleHelloObject"&nbsp;classpath="."&nbsp;/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;echo&nbsp;message="Ant&nbsp;appears&nbsp;to&nbsp;be&nbsp;successfully&nbsp;installed"&nbsp;/&gt;<br>
&nbsp;&nbsp;&lt;/target&gt;<br>
<br>
&lt;/project&gt;<br>
</div></div>
		</p><p>On a linux system with the build.xml file in /tmp you should see output like:<div class="literallayout"><br>
				<tt>bash-2.04$&nbsp;ant<br>
Buildfile:&nbsp;build.xml<br>
<br>
init:<br>
<br>
ASimpleHelloObject:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[echo]&nbsp;Wrote&nbsp;ASimpleHelloObject.java<br>
<br>
compile:<br>
&nbsp;&nbsp;&nbsp;&nbsp;[javac]&nbsp;Compiling&nbsp;1&nbsp;source&nbsp;file&nbsp;to&nbsp;/tmp<br>
<br>
run:<br>
ASimpleHelloObject.main&nbsp;was&nbsp;called<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[echo]&nbsp;Ant&nbsp;appears&nbsp;to&nbsp;be&nbsp;successfully&nbsp;installed<br>
<br>
BUILD&nbsp;SUCCESSFUL<br>
<br>
Total&nbsp;time:&nbsp;2&nbsp;seconds</tt><br>
			</div>On a win32 system with the build.xml file in D:/temp you should see output like:<div class="literallayout"><br>
				<tt><br>
D:\temp&gt;ant<br>
Buildfile:&nbsp;build.xml<br>
<br>
init:<br>
<br>
ASimpleHelloObject:<br>
<br>
compile:<br>
&nbsp;&nbsp;&nbsp;&nbsp;[javac]&nbsp;Compiling&nbsp;1&nbsp;source&nbsp;file&nbsp;to&nbsp;D:\temp<br>
<br>
run:<br>
ASimpleHelloObject.main&nbsp;was&nbsp;called<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[echo]&nbsp;Ant&nbsp;appears&nbsp;to&nbsp;be&nbsp;successfully&nbsp;installed<br>
<br>
BUILD&nbsp;SUCCESSFUL<br>
<br>
Total&nbsp;time:&nbsp;2&nbsp;seconds<br>
</tt><br>
			</div>If instead out see something like:<div class="literallayout"><br>
				<tt><br>
D:\temp&gt;ant<br>
<br>
Warning:&nbsp;JAVA_HOME&nbsp;environment&nbsp;variable&nbsp;is&nbsp;not&nbsp;set.<br>
&nbsp;&nbsp;If&nbsp;build&nbsp;fails&nbsp;because&nbsp;sun.*&nbsp;classes&nbsp;could&nbsp;not&nbsp;be&nbsp;found<br>
&nbsp;&nbsp;you&nbsp;will&nbsp;need&nbsp;to&nbsp;set&nbsp;the&nbsp;JAVA_HOME&nbsp;environment&nbsp;variable<br>
&nbsp;&nbsp;to&nbsp;the&nbsp;installation&nbsp;directory&nbsp;of&nbsp;java.<br>
<br>
Buildfile:&nbsp;build.xml<br>
<br>
init:<br>
<br>
ASimpleHelloObject:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[echo]&nbsp;Wrote&nbsp;ASimpleHelloObject.java<br>
<br>
compile:<br>
&nbsp;&nbsp;&nbsp;&nbsp;[javac]&nbsp;Modern&nbsp;compiler&nbsp;is&nbsp;not&nbsp;available&nbsp;-&nbsp;using&nbsp;classic&nbsp;compiler<br>
&nbsp;&nbsp;&nbsp;&nbsp;[javac]&nbsp;Compiling&nbsp;1&nbsp;source&nbsp;file&nbsp;to&nbsp;D:\temp<br>
<br>
BUILD&nbsp;FAILED<br>
<br>
D:\temp\build.xml:22:&nbsp;Cannot&nbsp;use&nbsp;classic&nbsp;compiler,&nbsp;as&nbsp;it&nbsp;is&nbsp;not&nbsp;available&nbsp;A&nbsp;comm<br>
on&nbsp;solution&nbsp;is&nbsp;to&nbsp;set&nbsp;the&nbsp;environment&nbsp;variable&nbsp;JAVA_HOME&nbsp;to&nbsp;your&nbsp;jdk&nbsp;directory.<br>
<br>
Total&nbsp;time:&nbsp;1&nbsp;second<br>
</tt><br>
			</div>then you need to setup the JAVA_HOME environment to point to your JDK 1.3 installation.</p></div><table border="0" cellpadding="0" cellspacing="0" height="65"><tr height="65"><td rowspan="2"><img src="gbar.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/gbar.gif" width="432" height="79"></td><td rowspan="2" background="gbar.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/gbar.gif" width="100%" align="right" valign="top"><a href="index.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/index.html"><img src="doc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/doc.gif" border="0"></a><a href="ch01.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch01.html"><img src="toc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/toc.gif" border="0"></a><a href="ch01.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch01.html"><img src="prev.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/prev.gif" border="0"></a><a href="ch01s06.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch01s06.html"><img src="next.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/next.gif" border="0"></a></td></tr><tr></tr></table></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -