You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Zhendi Su <ra...@oracle.com> on 2002/02/01 01:05:59 UTC

javac: invalid flag -sourcepath???

Hi,

I am trying to compile some .java files and my task looks like:

<javac srcdir="${JAVAC_SRC}/common"  destdir="${okcbasedir}/classes"
target="1.1" bootclasspath="/local/java/jdk1.1.8/lib/classes.zip"
extdirs=" " depend="True" failonerror="False" >

<classpath path="${CLASSPATH}"/>
<exclude name="${JAVAC_SRC}/common/RCS/**" />

</javac>

When I ran ant, it gave me an error message saying:
 [javac] javac: invalid flag: -sourcepath
    [javac] use: javac
[-g][-O][-debug][-depend][-nowarn][-verbose][-classpath p
ath][-nowrite][-deprecation][-d dir][-J<runtime flag>] file.java...

This really surprised me because I had a similar javac task before and
it worked perfect.  Also, Isn't -sourcepath a valid flag in javac?  And
this -sourcepath flag is gerenated by ant...  I ran ant using -verbose
option and the compilation argument is follows:

   [javac] Compiling 5 source files to /home/rsu/okcbuild/classes
    [javac] Using classic compiler
    [javac] Compilation args: -d /home/rsu/okcbuild/classes -classpath
/home/rsu
/okcbuild/classes:/home/bhenriqu/okx.jar:/afrz/crmcon/kdv7core/comn/java/jdbc111

.zip:/afrz/crmcon/kdv7core/comn/java/xmlparserv2.zip:/oracle/apache/ojsp/servlet

.jar:/afrz/crmcon/kdv7core/comn/java/apps.zip:/home/rsu/Ant/lib/jaxp.jar:/home/r

su/Ant/lib/jakarta-ant-1.4.1-optional.jar:/home/rsu/Ant/lib/crimson.jar:/home/rs

u/Ant/lib/ant.jar:/local/java/jdk1.1.8/lib/classes.zip:/local/netscape404/java/c

lasses/java40.jar:/okcdev/okc/11.5/java:/local/java/jdk1.2.2/lib/tools.jar
-sour
cepath /afrz/crmcon/kdv7core/comn/java/oracle/apps/okc/common -target 1
.1 -bootclasspath /local/java/jdk1.1.8/lib/classes.zip -extdirs
/home/rsu/okcbui
ld -g:none -Xdepend


Anyone got an idea why?

Thanks a lot!

Zhendi Su



Re: javac: invalid flag -sourcepath???

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 31 Jan 2002, Zhendi Su <ra...@oracle.com> wrote:

> I am trying to compile some .java files and my task looks like:

You are trying to use JDK's 1.1 compiler while running in a 1.2 JVM.
Ant uses comman line switches that match the version of JDK it is
running on, -sourcepath didn't exist in 1.1 but Ant will use it as it
is running on a 1.2 VM.

Fix: Use the JDK 1.1 java executable to run Ant.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>