ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barry White <bwh...@fotango.com>
Subject Re: where is the problem?
Date Tue, 20 Sep 2005 12:47:15 GMT
Ant must be using a different environment then, because it can't find 
javax.servlet

My advice would be to forget eclipse for now and get the build working 
on the command line. How many javac's do you have on your system? Which 
one is in your PATH? What is JAVA_HOME set to? If JAVA_HOME is set to a 
J2SE installation there will be no javax.servlet in the classpath - 
unless explicitly set in CLASSPATH or in the build file.

Eclipse may just confuse matters while you are learning Ant. Get back to 
basics and make sure Ant is set up correctly. I only use eclipse for 
code editing - Ant does the rest.

Good luck,
Barry

Aydın Toprak wrote:
> Thanks Barry,
> But I have already added those paths to my enviroment and everything 
> (excep this) works smoothly.. how ever, it still resists about the 
> missing packages.. but I have them and can compile the java code on the 
> command promp, in the same directory..
> 
> 
> 
> Barry White wrote:
> 
>> Hi Aydin,
>>
>> try putting the servlet (J2EE) classes in the classpath for the javac 
>> task. The following page shows you how to do this under references (it 
>> should look familiar):
>>
>> http://ant.apache.org/manual/using.html
>>
>> Barry
>>
>> Aydın Toprak wrote:
>>
>>> hii everybody,
>>>
>>> I am newbie about ant I am having difficulties about ant+eclipse 
>>> combination...
>>> Now I have a working source code, I can compile it under the command 
>>> line .. without any problems..
>>>
>>> how ever I couldnt been able to compile it via using ant .. .
>>> When I call it from eclipse, I get some intresiting errors from 
>>> compiler..
>>>
>>> that, for example, says, "\workspace\mysecond\src\form.java:2: 
>>> package javax.servlet does not exist
>>>    [javac] import javax.servlet.*;"
>>>
>>> and continues..
>>>
>>> this is only specific problem when I use ant to compile and deploy it..
>>> so I think it is related with my build.xml file.. which is...
>>>
>>> <project name="mysecond" default="dist" basedir=".">
>>>    <description>
>>>        description tag leri arasi
>>>    </description>
>>>  <!-- set global properties for this build -->
>>>  <property name="src" location="src"/>
>>>  <property name="build" location="mybuildfolder"/>
>>>  <property name="dist"  location="mydistfolder"/>
>>>
>>>  <target name="init">
>>>    <!-- Create the time stamp -->
>>>    <tstamp/>
>>>    <!-- Create the build directory structure used by compile -->
>>>    <mkdir dir="${build}"/>
>>>  </target>
>>>
>>>  <target name="compile" depends="init"
>>>        description="compile the source " >
>>>    <!-- Compile the java code from ${src} into ${build} -->
>>>    <javac srcdir="${src}" destdir="${build}"/>
>>>  </target>
>>>
>>>  <target name="dist" depends="compile"
>>>        description="generate the distribution" >
>>>    <!-- Create the distribution directory -->
>>>    <mkdir dir="${dist}/lib"/>
>>>
>>>    <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar 
>>> file -->
>>>    <jar jarfile="${dist}/lib/mysecond -${DSTAMP}.jar" 
>>> basedir="${build}"/>
>>>  </target>
>>>
>>>  <target name="clean"
>>>        description="clean up" >
>>>    <!-- Delete the ${build} and ${dist} directory trees -->
>>>    <delete dir="${build}"/>
>>>    <delete dir="${dist}"/>
>>>  </target>
>>> </project>
>>>
>>>
>>>
>>> I think I am misiing a little point but really getting  exhausted 
>>> about that...
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>> For additional commands, e-mail: user-help@ant.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message