You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by MM...@legend.cz on 2000/11/06 10:46:34 UTC

RE: BUILD FATAL ERROR: srcdir does not exist!

Hello,
thank You for your reaction about this problem in Tomcat discussion. Sorry,
Jacob, that I didnt reply to You, because I did not look at discussion.
Today Phil Mitchell writes to me, that he has the same problem. I looked at
discussion and i saw Jacobs reply. So I tried to build sample Tomcats
aaplication again and got strange results:
1) when I put line
  <property name="build.compiler" value="classic"/>
 recomended by Jacob into build.xml and start build, I got an error:

C:\java\sample>build
Buildfile: build.xml
Project base dir set to: C:\java\sample
The items attribute is deprecated. Please use the includes attribute.
The items attribute is deprecated. Please use the includes attribute.
Executing Target: prepare
Created dir: C:\java\tomcat\webapps\sample
Copying 3 files to C:\java\tomcat\webapps\sample
Created dir: C:\java\tomcat\webapps\sample\WEB-INF
Created dir: C:\java\tomcat\webapps\sample\WEB-INF\classes
Created dir: C:\java\tomcat\webapps\sample\WEB-INF\lib
Created dir: C:\java\tomcat\webapps\sample\javadoc
Executing Target: compile
Compiling 1 source files to C:\java\tomcat\webapps\sample\WEB-INF\classes
Exception in thread "main" java.lang.NoClassDefFoundError: sun/tools/javac/Main
        at org.apache.tools.ant.taskdefs.Javac.doClassicCompile(Javac.java:421)
        at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:218)
        at org.apache.tools.ant.Target.execute(Target.java:120)
        at org.apache.tools.ant.Project.runTarget(Project.java:675)
        at org.apache.tools.ant.Project.executeTarget(Project.java:422)
        at org.apache.tools.ant.Main.runBuild(Main.java:240)
        at org.apache.tools.ant.Main.main(Main.java:191)

2) when I start build without that line, EVERYTHING IS OK AND BUILD
SUCCEED. I dont know why, because the conditions seem the same as when I
got the error.

C:\java\sample>build
Buildfile: build.xml
Project base dir set to: C:\java\sample
The items attribute is deprecated. Please use the includes attribute.
The items attribute is deprecated. Please use the includes attribute.
Executing Target: prepare
Created dir: C:\java\tomcat\webapps\myapp
Copying 3 files to C:\java\tomcat\webapps\myapp
Created dir: C:\java\tomcat\webapps\myapp\WEB-INF
Created dir: C:\java\tomcat\webapps\myapp\WEB-INF\classes
Created dir: C:\java\tomcat\webapps\myapp\WEB-INF\lib
Created dir: C:\java\tomcat\webapps\myapp\javadoc
Executing Target: compile
Compiling 1 source files to C:\java\tomcat\webapps\myapp\WEB-INF\classes
Performing a Modern Compile
Completed in 1 seconds
C:\java\sample>

so, because I have not time to solve it, I only list my source sample
directory to you and also my system variables.

C:\java\sample: build.xml, build.bat, build
C:\java\sample\etc: web.xml
C:\java\sample\lib: <empty>
C:\java\sample\src\Hello.java
C:\java\sample\web\hello.jsp, index.html
C:\java\sample\web\images\tomcat.gif

(See attached file: build.xml)(See attached file: build.bat)(See attached
file: build)(See attached file: web.xml)(See attached file: Hello.java)(See
attached file: index.html)(See attached file: hello.jsp)(See attached file:
tomcat.gif)

C:\java\sample>set
TMP=C:\WINDOWS\TEMP
TEMP=C:\WINDOWS\TEMP
PROMPT=$p$g
winbootdir=C:\WINDOWS
COMSPEC=C:\COMMAND.COM
JAVA_HOME=C:\java\jdk1.3
TOMCAT_HOME=C:\java\tomcat
INFORMIXDIR=C:\PROGRA~1\INFORMIX
windir=C:\WINDOWS
BLASTER=A240 I11 D0 T4
PATH=Z:\PUBLIC;Y:\;C:\WINDOWS;C:\WINDOWS\COMMAND;C:\PWRS\SYS32;C:\PROGRA~1\INFOR
MIX\BIN;C:\JAVA\JDK1.3\BIN;C:\PROGRA~1\SYBASE\IM6;
CMDLINE=java org.apache.tools.ant.Main -Dtomcat.home=C:\java\tomcat
CLASSPATH=.;C:\java\ifxjdbc2.1\lib\ifxjdbc.jar;C:\java\tomcat\lib\servlet.jar;C:
\java\tomcat\lib\webserver.jar;C:\java\tomcat\lib\xml.jar;C:\java\tomcat\lib\ant
.jar;C:\java\tomcat\lib\jasper.jar;C:\java\cos\lib\cos.jar;

=====================================================================
original message:
=====================================================================

Hello,
excuse my bad English. I downloaded Tomcat 3.1 and installed on my PC. I
use Windows 95 and JDK 1.3. Every environment variables I have properly
set. I am trying to build sample application, which is in doc/appdev/sample
directory:
1) First I got error concerning with SAX XML parser and the cause was, that
in build.xml file was missing "/>" at the end of line
  <property name="app.name"       value="myapp"
So, please, correct it in downloadable files!

2) Then when I started build from ms-dos prompt (beeing in directory
...samples), I have following error:

C:\java\sample>build
Buildfile: build.xml
Project base dir set to: C:\java\sample
The items attribute is deprecated. Please use the includes attribute.
The items attribute is deprecated. Please use the includes attribute.
Executing Target: prepare
Created dir: C:\java\tomcat\webapps\myapp
Copying 3 files to C:\java\tomcat\webapps\myapp
Created dir: C:\java\tomcat\webapps\myapp\WEB-INF
Created dir: C:\java\tomcat\webapps\myapp\WEB-INF\classes
Created dir: C:\java\tomcat\webapps\myapp\WEB-INF\lib
BUILD FATAL ERROR: srcdir does not exist!
C:\java\sample>

But subdirectory src subdirectory exists and in build.xml is

  <target name="compile" depends="prepare" init="init">
    <javac srcdir="src" destdir="${deploy.home}/WEB-INF/classes"
           classpath="${deploy.home}/WEB-INF/classes"
           debug="on" optimize="off" deprecation="off"/>
  </target>

I had to compile HelloWorld separately by javac and place it to
webapps/myapp/Web-inf/classes and then it worked ok. When I tried to use
JDK1.2.2 I had the same problem, and also in Linux.
So, please, what is wrong?

Thank you very much. Have a good time.

Michal Mazny.Prague.Czech Republic.Europe.World.Universe.God