ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: AW: AW: beginners problem: unable to find compile...
Date Thu, 23 Sep 2004 06:40:49 GMT
Have to have a look into the sources ...
oata.taskdefs.compilers.CompilerAdapterFactory ...
Try setting 
  <javac compiler="classic">...

Basically the Factory does (with "modern" compiler):
- try to load the "com.sun.tools.javac.Main" class
- if ok
  --> you´ll get it
- if not
  --> fallback strategy
  if java version is 1.1/1.2/1.3
    --> you´ll get the old "sun.tools.javac.Main"
  if not
    --> error message "Unable to find a javac compiler;
com.sun.tools.javac.Main [... not CP...]"

So reverted from your error message
- Ant found a Java 1.4
- Ant didnt find the com.sun.tools.javac.Main
- you´re using Ant 1.5
- tools.jar is provided as first entry in Ant´s classpath


Does that tools.jar contain the class com.sun.tools.javac.Main class? (last
hope...)

Otherwise, sorry - no ideas any more.
Someone else?


Jan

> -----Ursprüngliche Nachricht-----
> Von: james.burton@brighton-hove.gov.uk
> [mailto:james.burton@brighton-hove.gov.uk]
> Gesendet am: Mittwoch, 22. September 2004 18:25
> An: Ant Users List
> Betreff: Re: AW: AW: beginners problem: unable to find compile...
> 
> 
> the classpath in java.class.path looks good to me, those are the right
> paths on my machine.
> 
> I edited ant.bat, typed 'set CLASSPATH=' and tried to compile 
> your test -
> this is the output:
> 
> ------------------------------------------------
> C:\Documents and Settings\jamesburton\My
> Documents\java\src\testAnt>"C:\j2sdk1.4.2_02\bin\java.exe"  -classpath
> "C:\j2sdk1.4.2_02\lib\tools.jar;C:\apache\ant\lib\xml-apis.jar
> ;C:\apache\ant\lib\xercesImpl.jar;C:\apache\ant\lib\optional.j
> ar;C:\apache\ant\lib\ant.jar;%CLASSPATH%;C:\ORACLE\ORA92\JDBC\
> LIB\CLASSES12.JAR"
>  "-Dant.home=C:\apache\ant" org.apache.tools.ant.Main  compile
> Buildfile: build.xml
> 
> compile:
>     [javac] Compiling 1 source file to C:\Documents and
> Settings\jamesburton\My Documents\java\src\testAnt
> 
> C:\Documents and Settings\jamesburton\My 
> Documents\java\src\testAnt>goto
> end
> 
> C:\Documents and Settings\jamesburton\My 
> Documents\java\src\testAnt>set
> LOCALCLASSPATH=
> 
> C:\Documents and Settings\jamesburton\My 
> Documents\java\src\testAnt>set
> _JAVACMD=
> 
> C:\Documents and Settings\jamesburton\My 
> Documents\java\src\testAnt>set
> ANT_CMD_LINE_ARGS=
> 
> C:\Documents and Settings\jamesburton\My Documents\java\src\testAnt>if
> "Windows_NT" == "Windows_NT"
> 
> C:\Documents and Settings\jamesburton\My Documents\java\src\testAnt>if
> exist "C:\Lynx\antrc_post.bat" call "C:\Lynx\antrc_post.bat"
> --------------------------------------------------------------
> --------------------------------
> 
> Then the 'unable to find a javac compiler' message
> 
> All the paths in that output are right too...help! :-(
>                        
>  James Burton          
>                        
>  Web Developer         
>                        
>  Database and          
>  Development           
>                        
>  Cultural Services     
>                        
>  Brighton & Hove City  
>  Council               
>                        
>  tel: 01273 293594     
>                        
> 
> 
> 
> 
> 
>                                                               
>                                                               
>                     
>                                                               
>                                                               
>                     
>                           Jan.Materne@rzf.fin-nrw  To:    
> user@ant.apache.org                                           
>                         
>                                     .de            cc:        
>                                                               
>                     
>                                                    Subject:   
>   AW: AW: beginners problem: unable to find compile...        
>                     
>                              22/09/2004 17:02                 
>                                                               
>                     
>                                                               
>                                                               
>                     
>                           Please respond to "Ant              
>                                                               
>                     
>                                 Users List"                   
>                                                               
>                     
>                                                               
>                                                               
>                     
>                                                               
>                                                               
>                     
> 
> 
> 
> 
> What should the "%CLASSPATH%" in java.class.path be?
> type a "set CLASSPATH=" before invoking Ant.
> 
> Just for debugging ... modify bin\ant.bat.
> Search for ":runAnt" and type an "echo" before the '"%_JAVACMD%" ...'
> statement.
> Do the same on ":runAntWithClasspath".
> (quicker but much more output would be setting "@echo on" in the first
> line)
> 
> 
> Sorry - but I believe Ant is using a JRE on your machine ...
> 
> 
> Jan
> 
> > -----Ursprüngliche Nachricht-----
> > Von: james.burton@brighton-hove.gov.uk
> > [mailto:james.burton@brighton-hove.gov.uk]
> > Gesendet am: Mittwoch, 22. September 2004 17:53
> > An: Ant Users List
> > Betreff: Re: AW: beginners problem: unable to find compile...
> >
> >
> > Thanks Jan,
> >
> > your simple test gives me the same error. JAVA_HOME *is*
> > pointing to my
> > sdk, and tools.jar exists - the diagnostics output seems to
> > indicate that
> > ant should be able to find it:
> >
> > > java.class.path :
> > > C:\j2sdk1.4.2_02\lib\tools.jar;C:\apache\ant\lib\xml-apis.jar;
> > > C:\apache\ant\lib\xercesImpl.jar;C:\apache\ant\lib\optional.ja
> > > r;C:\apache\ant\lib\ant.jar;%CLASSPATH%;C:\ORACLE\ORA92\JDBC\L
> > > IB\CLASSES12.JAR
> >
> > (note that this classpath isn't set by me). However, it also says
> >
> > > java.runtime.name : Java(TM) 2 Runtime Environment, 
> Standard Edition
> > > sun.boot.library.path : C:\j2sdk1.4.2_02\jre\bin
> >
> > which seems like ant may be pointing to the jre not sdk...?
> >
> >
> >
> > hmmm, I updated to ant 1.6.2 and get the following
> >
> > C:\DOCUME~1\JAMESB~1\MYDOCU~1\java\src\DBMONI~1>ant -version
> > java.lang.InstantiationException: org.apache.tools.ant.Main
> >         at java.lang.Class.newInstance0(Class.java:293)
> >         at java.lang.Class.newInstance(Class.java:261)
> >         at 
> org.apache.tools.ant.launch.Launcher.run(Launcher.java:195)
> >         at 
> org.apache.tools.ant.launch.Launcher.main(Launcher.java:55)
> > C:\DOCUME~1\JAMESB~1\MYDOCU~1\java\src\DBMONI~1>
> >
> > so I'm sticking with 1.5 for now.
> >
> >  James Burton
> >
> >  Web Developer
> >
> >  Database and
> >  Development
> >
> >  Cultural Services
> >
> >  Brighton & Hove City
> >  Council
> >
> >  tel: 01273 293594
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >                           Jan.Materne@rzf.fin-nrw  To:
> > user@ant.apache.org
> >
> >                                     .de            cc:
> >
> >
> >                                                    Subject:
> >   AW: beginners problem: unable to find compile...
> >
> >                              22/09/2004 16:29
> >
> >
> >
> >
> >
> >                           Please respond to "Ant
> >
> >
> >                                 Users List"
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > 1. if possible update to Ant 1.6.2 :)
> > 2. you dont have to copy anything into %anthome%\lib any
> > more; external
> > jars
> > should be
> >    copied into %userhome%\.ant\lib (since 1.6); never heard
> > that tools.jar
> > should be
> >    copied into \lib ...
> > 3. are you REALLY using a JDK? look for 
> %JAVA_HOME%\lib\tools.jar ...
> > 4. try a very small example
> >
> > public class Test {
> >     public static void main(String[] args) {
> >         System.out.println("Hello World");
> >     }
> > }
> >
> > <project name="test" basedir="." default="run">
> >     <target name="compile">
> >         <javac srcdir="." destdir="." includes="Test.java"/>
> >     </target>
> >     <target name="run" depends="compile">
> >         <java classname="Test" classpath="."/>
> >     </target>
> > </project>
> >
> >
> > Jan
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: james.burton@brighton-hove.gov.uk
> > > [mailto:james.burton@brighton-hove.gov.uk]
> > > Gesendet am: Mittwoch, 22. September 2004 17:10
> > > An: user@ant.apache.org
> > > Betreff: beginners problem: unable to find compile...
> > >
> > > I am using ant 1.5 and for compile tasks I get the error:
> > >
> > > ...unable to find a javac compiler:
> > > com.sun.tools.javac.Main is not on the classpath.
> > > Perhaps JAVA_HOME does not point to the JDK
> > >
> > > when trying to compile anything. JAVA_HOME is set to my sdk
> > > home, CLASSPATH
> > > is not set, ANT_HOME is correct. I've read a ton of posts
> > > about this, all
> > > of which say to copy tools.jar into $ANT_HOME/lib - I've
> > done that and
> > > still got the problem.
> > >
> > > this is the output of ant -diagnostics:
> > >
> > > ------- Ant diagnostics report -------
> > > Apache Ant version 1.5 compiled on July 9 2002
> > >
> > > -------------------------------------------
> > >  Implementation Version (JDK1.2+ only)
> > > -------------------------------------------
> > > core tasks     : 1.5
> > > optional tasks : not available
> > >
> > > -------------------------------------------
> > >  ANT_HOME/lib jar listing
> > > -------------------------------------------
> > > ant.jar (732490 bytes)
> > > optional.jar (668804 bytes)
> > > xercesImpl.jar (885250 bytes)
> > > xml-apis.jar (108484 bytes)
> > >
> > > -------------------------------------------
> > >  Tasks availability
> > > -------------------------------------------
> > > propertyfile : Not Available
> > > vsscheckin : Not Available
> > > p4reopen : Not Available
> > > csc : Not Available
> > > wlrun : Not Available
> > > p4label : Not Available
> > > p4revert : Not Available
> > > replaceregexp : Not Available
> > > get : Not Available
> > > jjtree : Not Available
> > > jarlib-display : Not Available
> > > jspc : Not Available
> > > test : Not Available
> > > vsshistory : Not Available
> > > icontract : Not Available
> > > p4submit : Not Available
> > > ccmcheckin : Not Available
> > > p4change : Not Available
> > > p4delete : Not Available
> > > vssadd : Not Available
> > > translate : Not Available
> > > vajload : Not Available
> > > jarlib-available : Not Available
> > > WsdlToDotnet : Not Available
> > > jpcovmerge : Not Available
> > > ejbjar : Not Available
> > > stlist : Not Available
> > > serverdeploy : Not Available
> > > cccheckin : Not Available
> > > wljspc : Not Available
> > > telnet : Not Available
> > > sosget : Not Available
> > > p4sync : Not Available
> > > p4edit : Not Available
> > > maudit : Not Available
> > > antlr : Not Available
> > > netrexxc : Not Available
> > > ftp : Not Available
> > > jpcovreport : Not Available
> > > ccmcheckout : Not Available
> > > xmlvalidate : Not Available
> > > iplanet-ejbc : Not Available
> > > ccmcheckintask : Not Available
> > > native2ascii : Not Available
> > > starteam : Not Available
> > > vsscheckout : Not Available
> > > soscheckin : Not Available
> > > stylebook : Not Available
> > > mimemail : Not Available
> > > stlabel : Not Available
> > > cab : Not Available
> > > splash : Not Available
> > > cccheckout : Not Available
> > > p4have : Not Available
> > > jdepend : Not Available
> > > script : Not Available
> > > ccmcreatetask : Not Available
> > > rpm : Not Available
> > > mmetrics : Not Available
> > > echoproperties : Not Available
> > > junit : Not Available
> > > stcheckin : Not Available
> > > vajexport : Not Available
> > > stcheckout : Not Available
> > > vsscreate : Not Available
> > > ejbc : Not Available
> > > wsdltodotnet : Not Available
> > > junitreport : Not Available
> > > ccupdate : Not Available
> > > renameext : Not Available
> > > vsslabel : Not Available
> > > vsscp : Not Available
> > > vajimport : Not Available
> > > setproxy : Not Available
> > > wlstop : Not Available
> > > p4counter : Not Available
> > > ilasm : Not Available
> > > soscheckout : Not Available
> > > jarlib-resolve : Not Available
> > > ccuncheckout : Not Available
> > > jlink : Not Available
> > > javacc : Not Available
> > > jarlib-manifest : Not Available
> > > pvcs : Not Available
> > > sound : Not Available
> > > mparse : Not Available
> > > blgenclient : Not Available
> > > javah : Not Available
> > > ccmreconfigure : Not Available
> > > p4add : Not Available
> > > soslabel : Not Available
> > > jpcoverage : Not Available
> > > depend : Not Available
> > > vssget : Not Available
> > > ddcreator : Not Available
> > >
> > > -------------------------------------------
> > >  org.apache.env.Which diagnostics
> > > -------------------------------------------
> > > Not available.
> > > Download it at http://xml.apache.org/commons/
> > >
> > > -------------------------------------------
> > >  System properties
> > > -------------------------------------------
> > > java.runtime.name : Java(TM) 2 Runtime Environment, 
> Standard Edition
> > > sun.boot.library.path : C:\j2sdk1.4.2_02\jre\bin
> > > java.vm.version : 1.4.2_02-b03
> > > java.vm.vendor : Sun Microsystems Inc.
> > > java.vendor.url : http://java.sun.com/
> > > path.separator : ;
> > > java.vm.name : Java HotSpot(TM) Client VM
> > > file.encoding.pkg : sun.io
> > > user.country : GB
> > > sun.os.patch.level : Service Pack 4
> > > java.vm.specification.name : Java Virtual Machine Specification
> > > user.dir : C:\Documents and Settings\jamesburton\My
> > > Documents\java\src\dbmonitor
> > > java.runtime.version : 1.4.2_02-b03
> > > java.awt.graphicsenv : sun.awt.Win32GraphicsEnvironment
> > > java.endorsed.dirs : C:\j2sdk1.4.2_02\jre\lib\endorsed
> > > os.arch : x86
> > > java.io.tmpdir : C:\DOCUME~1\JAMESB~1\LOCALS~1\Temp\
> > > line.separator :
> > >
> > > java.vm.specification.vendor : Sun Microsystems Inc.
> > > user.variant :
> > > os.name : Windows 2000
> > > ant.home : C:\apache\ant
> > > sun.java2d.fontpath :
> > > java.library.path :
> > > C:\j2sdk1.4.2_02\bin;.;C:\WINNT\system32;C:\WINNT;.;C:\Perl\bi
> > > n\;C:\Perl\5.00502\bin\MSWin32-x86-object;C:\Perl\5.00502\bin;
> > > C:\j2sdk1.4.2_02\bin;C:\oracle\ora92\bin;C:\Program
> > >  Files\Oracle\jre\1.3.1\bin;C:\Program
> > > Files\Oracle\jre\1.1.8\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT
> > > \System32\Wbem;C:\WINNT\system32\nls;C:\WINNT\system32\nls\ENG
> > > LISH;C:\ORACLE\ORA92\JDBC\LIB\CLASSES12.JAR;C:\apache\ant\bin;
> > > C:\PROGRA~1\XRAY;C:\Program
> > >  Files\Common
> > Files\GTK\2.0\bin;C:\cygwin\bin;C:\Lynx;C:\Documents and
> > > Settings\jamesburton\bin;Z:.;Y:.;
> > > java.specification.name : Java Platform API Specification
> > > java.class.version : 48.0
> > > java.util.prefs.PreferencesFactory :
> > > java.util.prefs.WindowsPreferencesFactory
> > > os.version : 5.0
> > > user.home : C:\Documents and Settings\jamesburton
> > > user.timezone :
> > > java.awt.printerjob : sun.awt.windows.WPrinterJob
> > > file.encoding : Cp1252
> > > java.specification.version : 1.4
> > > java.class.path :
> > > C:\j2sdk1.4.2_02\lib\tools.jar;C:\apache\ant\lib\xml-apis.jar;
> > > C:\apache\ant\lib\xercesImpl.jar;C:\apache\ant\lib\optional.ja
> > > r;C:\apache\ant\lib\ant.jar;%CLASSPATH%;C:\ORACLE\ORA92\JDBC\L
> > > IB\CLASSES12.JAR
> > > user.name : jamesburton
> > > java.vm.specification.version : 1.0
> > > java.home : C:\j2sdk1.4.2_02\jre
> > > sun.arch.data.model : 32
> > > user.language : en
> > > java.specification.vendor : Sun Microsystems Inc.
> > > awt.toolkit : sun.awt.windows.WToolkit
> > > java.vm.info : mixed mode
> > > java.version : 1.4.2_02
> > > java.ext.dirs : C:\j2sdk1.4.2_02\jre\lib\ext
> > > sun.boot.class.path :
> > > C:\j2sdk1.4.2_02\jre\lib\rt.jar;C:\j2sdk1.4.2_02\jre\lib\i18n.
> > > jar;C:\j2sdk1.4.2_02\jre\lib\sunrsasign.jar;C:\j2sdk1.4.2_02\j
> > > re\lib\jsse.jar;C:\j2sdk1.4.2_02\jre\lib\jce.jar;C:\j2sdk1.4.2
> > > _02\jre\lib\charsets.jar;C:\j2sdk1.4.2_02\jre\classes
> > > java.vendor : Sun Microsystems Inc.
> > > file.separator : \
> > > java.vendor.url.bug : http://java.sun.com/cgi-bin/bugreport.cgi
> > > sun.io.unicode.encoding : UnicodeLittle
> > > sun.cpu.endian : little
> > > sun.cpu.isalist : pentium i486 i386
> > >
> > >
> > > Thanks!
> > >
> > >
> > >
> > >  James Burton
> > >
> > >  Web Developer
> > >
> > >  Database and
> > >  Development
> > >
> > >  Cultural Services
> > >
> > >  Brighton & Hove City
> > >  Council
> > >
> > >  tel: 01273 293594
> > >
> > >
> > >
> > >
> > >
> > >
> > 
> ______________________________________________________________________
> > > Notice to recipient:
> > > The information contained in this electronic mail message is
> > > intended only
> > > for the use of the individual to whom it is addressed and
> > may contain
> > > information which is privileged and confidential, the
> > > disclosure of which
> > > is prohibited by law.  If the reader of this message is not
> > > the intended
> > > recipient, please note that any dissemination, distribution
> > > or copying of
> > > this communication is strictly prohibited.  If you have
> > received this
> > > communication in error please notify the sender immediately.
> > > Thank you in
> > > anticipation of your co-operation.
> > >
> > > You can visit our website at http://www.brighton-hove.gov.uk
> > >
> > > Please consider the environment, only print out this email if
> > > absolutely
> > > necessary.
> > >
> > >
> > >
> > >
> > 
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > > For additional commands, e-mail: user-help@ant.apache.org
> >  >
> >
> >
> >
> > 
> ______________________________________________________________________
> > This e-mail has been sent to you from a person or
> > organisation outside of
> > Brighton & Hove City Council.  Whilst the Council has made
> > every effort to
> > protect its employees by ensuring that the content is free
> > from offensive
> > or otherwise unsuitable material it is possible that such
> > material may get
> > through.  If you receive any message that causes you concern
> > then please
> > call the ICT Service Desk on x2001 or forward it to
> > spam.mail@brighton-hove.gov.uk to assist us in keeping the
> > Council free
> > from such material.
> >
> > Please consider the environment, only print out this email if
> > absolutely
> > necessary.
> >
> >
> >
> > 
> ______________________________________________________________________
> > Notice to recipient:
> > The information contained in this electronic mail message is
> > intended only
> > for the use of the individual to whom it is addressed and 
> may contain
> > information which is privileged and confidential, the
>  > disclosure of which
> > is prohibited by law.  If the reader of this message is not
> > the intended
> > recipient, please note that any dissemination, distribution
> > or copying of
> > this communication is strictly prohibited.  If you have 
> received this
> > communication in error please notify the sender immediately.
> > Thank you in
> > anticipation of your co-operation.
> >
> > You can visit our website at http://www.brighton-hove.gov.uk
> >
> > Please consider the environment, only print out this email if
> > absolutely
> > necessary.
> >
> >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
>  >
> 
> 
> 
> ______________________________________________________________________
> This e-mail has been sent to you from a person or 
> organisation outside of
> Brighton & Hove City Council.  Whilst the Council has made 
> every effort to
> protect its employees by ensuring that the content is free 
> from offensive
> or otherwise unsuitable material it is possible that such 
> material may get
> through.  If you receive any message that causes you concern 
> then please
> call the ICT Service Desk on x2001 or forward it to
> spam.mail@brighton-hove.gov.uk to assist us in keeping the 
> Council free
> from such material.
> 
> Please consider the environment, only print out this email if 
> absolutely
> necessary.
> 
> 
> 
> ______________________________________________________________________
> Notice to recipient:
> The information contained in this electronic mail message is 
> intended only
> for the use of the individual to whom it is addressed and may contain
> information which is privileged and confidential, the 
> disclosure of which
> is prohibited by law.  If the reader of this message is not 
> the intended
> recipient, please note that any dissemination, distribution 
> or copying of
> this communication is strictly prohibited.  If you have received this
> communication in error please notify the sender immediately.  
> Thank you in
> anticipation of your co-operation.
> 
> You can visit our website at http://www.brighton-hove.gov.uk
> 
> Please consider the environment, only print out this email if 
> absolutely
> necessary.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message