Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 83854 invoked from network); 14 Jul 2004 19:07:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 14 Jul 2004 19:07:09 -0000 Received: (qmail 84086 invoked by uid 500); 14 Jul 2004 19:06:58 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 84036 invoked by uid 500); 14 Jul 2004 19:06:58 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 84017 invoked by uid 99); 14 Jul 2004 19:06:58 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.225.128.174] (HELO dogfood.dsystems.net) (209.225.128.174) by apache.org (qpsmtpd/0.27.1) with ESMTP; Wed, 14 Jul 2004 12:06:56 -0700 Received: from dougl ([209.225.128.190]) by dogfood.dsystems.net (Post.Office MTA v3.5.2 release 221 ID# 0-71134U1000L100S0V35) with SMTP id net for ; Wed, 14 Jul 2004 15:06:49 -0400 Message-ID: <007c01c469d6$17de9f00$3d78030a@dougl> From: "Doug Lochart" To: "Ant Users List" References: <40F4366F.6010607@ecommstats.com> <001e01c46911$60ea12d0$3d78030a@dougl> <40F43D9D.3040703@ecommstats.com> <003c01c46919$812b3d50$3d78030a@dougl> <40F47E71.8070904@ecommstats.com> <002201c469b3$30e457b0$3d78030a@dougl> <40F577CB.9040307@ecommstats.com> Subject: Re: Javac problem Date: Wed, 14 Jul 2004 15:09:31 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N There might be but it depends on how/where your bash resource files are loaded. Typically you will have a .bash_profile that then checks the existence of .bashrc and then sources it if it exists. Your .bash_profile may probably sources a system wide profile like "/etc/bash_profile". However if you run echo $JAVA_HOME on your command line and you see the right stuff then your login shell is fine. However, subshells are not login shells unless you specify it as such. A login shell will source your .bash_profile but a non login shell won't! So if you are running ant like "bash ./ant" then your environment is not being set correctly. Also you may be sourcing a .antrc file somewhere either by your doing or a sourced global resource file. Are you familiar with .bash_profile and .bashrc? If so I would walk the chain to see exactly what and where things are getting set. You can also explicitly export JAVA_HOME in your .bashrc (if it is being sourced) or simply do it in the shell before you run ant. I checked the ant script and it uses exec to launch ant so your environment should be getting passed into ant. Have you run ant -diagnostics yet? If so maybe you could post the output. doug Now I've gained some understanding Of the only world that we see. Things that I once dreamed of Have become reality. These walls that still surround me Still contain the same old me, Just one more who's searching for A world that ought to be. ----- Original Message ----- From: "Travis Reeder" To: "Ant Users List" Sent: Wednesday, July 14, 2004 2:13 PM Subject: Re: Javac problem > I am not sure what is happening, it seems very odd to me. The CLASSPATH > is not set in the shell and I've tried it without the fork param (the > fork="true" was only to try to see if that would work which it didn't). > I just tried it with the 1.6.2 beta and still got the same thing. Even > tried reinstalling the jdk (I used the RPM install). I wonder if there > would be somewhere else where the CLASSPATH is being set? or JAVA_HOME > other than in the bash_profile that I set? > > Travis Reeder > Ecommstats Web Analytics > > > > Doug Lochart wrote: > > >I believe that the error message given by ant may be misleading us a little > >bit. A couple more things I can suggest to try. > >Make sure that your shell does not set the CLASSPATH variable before running > >ant. Ant takes care of this quite nicely and it can only cause problems. I > >have always been a believer in setting the classpath explicitly for each > >application and never in the environment. Secondly, I noticed that you were > >setting fork="true" for your build. Have you tried building your project > >without setting fork="true". If it does work then you will need to run ant > >once for each variation (fork=..) with -debug turned on. You can then > >compare the debug traces for each one to see where the problem lies. This > >is just a shot in the dark I know but it may shed some light. > > > >let me know what you find please > > > >thanks > > > >Doug > > > >PS: I am running red hat 9, ant 1.6, and jdk1.4.2_03 with no problems > >whatsoever > > > >Now I've gained some understanding > >Of the only world that we see. > >Things that I once dreamed of > >Have become reality. > > > >These walls that still surround me > >Still contain the same old me, > >Just one more who's searching for > >A world that ought to be. > >----- Original Message ----- > >From: "Travis Reeder" > >To: "Ant Users List" > >Sent: Tuesday, July 13, 2004 8:29 PM > >Subject: Re: Javac problem > > > > > > > > > >>i can run javac and everything from new shell, and the which finds it in > >>the right location, but I did another echo for java.class.path and it > >>shows as this: > >> > >>[echo] Classpath: . > >> > >>And yes that is a symlink, if I do the ant > >>-Djava.home=/usr/java/j2sdk1.4.2_05 I still get the same thing. > >> > >>BUILD FAILED > >>file:/home/v1/build.xml:36: 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 > >> > >>Travis Reeder > >>Ecommstats Web Analytics > >> > >> > >> > >>Doug Lochart wrote: > >> > >> > >> > >>>Travis, > >>> > >>>Simple Question. Can you open a new shell and run javac -version without > >>>having to manually set anything in your environment? > >>>If you can run the exe ... then at least its in your path. Next do a > >>>"which" or "whereis" command on javac and check it against the value of > >>>JAVA_HOME to verify that the JAVA_HOME is pointing to a valid > >>> > >>> > >installation. > > > > > >>>Next run ant-diagnostics in your shell and see what it says for > >>> > >>> > >java.home. > > > > > >>>If all that is fine then something else is awry that I cannot deduce > >>> > >>> > >without > > > > > >>>more info. If all else fails you should be able to simply run ant like > >>> > >>> > >this > > > > > >>>to override the java.home: > >>> > >>>ant -Djava.home=/usr/java/jdk > >>> > >>>Is this value a symlink? If so do you have access to it? > >>> > >>>Doug > >>> > >>> > >>> > >>> > >>>Now I've gained some understanding > >>>Of the only world that we see. > >>>Things that I once dreamed of > >>>Have become reality. > >>> > >>>These walls that still surround me > >>>Still contain the same old me, > >>>Just one more who's searching for > >>>A world that ought to be. > >>>----- Original Message ----- > >>>From: "Travis Reeder" > >>>To: "Ant Users List" > >>>Sent: Tuesday, July 13, 2004 3:53 PM > >>>Subject: Re: Javac problem > >>> > >>> > >>> > >>> > >>> > >>> > >>>>Hi Doug, running on Redhat 9 Enterprise, used export to set the vars and > >>>>also have them in .bash_profile so new shells have correct path set. > >>>>Unless I'm doing something totally wrong, but I check it by running > >>>>export and set to view the variables and they both are set correctly. > >>>>Is there anywhere else I should be doing the export? > >>>> > >>>>Travis Reeder > >>>>Ecommstats Web Analytics > >>>> > >>>> > >>>>Doug Lochart wrote: > >>>> > >>>> > >>>> > >>>> > >>>> > >>>>>Without more info the only thing I can suggest is that if you are > >>>>> > >>>>> > >running > > > > > >>>>> > >>>>> > >>>on > >>> > >>> > >>> > >>> > >>>>>a Unix system AND you are running ant from a shell that used SET > >>>>>JAVA_HOME=... to set the env variable then you will have to use export > >>>>>JAVA_HOME=... instead so that the new shell that is created for ANT > >>>>> > >>>>> > >will > > > > > >>>>>pick up the environment. When/if you reply back please be more > >>>>> > >>>>> > >specific > > > > > >>>>> > >>>>> > >>>on > >>> > >>> > >>> > >>> > >>>>>your operating environment. > >>>>> > >>>>>HTH > >>>>> > >>>>>Doug > >>>>> > >>>>> > >>>>>Now I've gained some understanding > >>>>>Of the only world that we see. > >>>>>Things that I once dreamed of > >>>>>Have become reality. > >>>>> > >>>>>These walls that still surround me > >>>>>Still contain the same old me, > >>>>>Just one more who's searching for > >>>>>A world that ought to be. > >>>>>----- Original Message ----- > >>>>>From: "Travis Reeder" > >>>>>To: > >>>>>Sent: Tuesday, July 13, 2004 3:22 PM > >>>>>Subject: Javac problem > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>>>I have the following settings in set: > >>>>>>JAVA_HOME=/usr/java/jdk > >>>>>> > >>>>>>When I run a compile task that looks like this my build.xml: > >>>>>> > >>>>>> >>>>>>deprecation="off" optimize="off" compiler="modern" > > >>>>>> > >>>>>> > >>>>>> > >>>>>>I get this: > >>>>>> > >>>>>>compile: > >>>>>> [echo] Java Home: /usr > >>>>>> [javac] Compiling 133 source files to /home/v1/web/WEB-INF/classes > >>>>>> > >>>>>>BUILD FAILED > >>>>>>file:/home/v1/build.xml:33: 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 > >>>>>> > >>>>>>The echo above is what ant sees as java.home property. Why would it > >>>>>> > >>>>>> > >be > > > > > >>>>>>set to that when I have JAVA_HOME set to the correct location? > >>>>>> > >>>>>>Travis > >>>>>> > >>>>>>-- > >>>>>>Travis Reeder > >>>>>>Ecommstats Web Analytics > >>>>>> > >>>>>> > >>>>>>--------------------------------------------------------------------- > >>>>>>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 > > > > > > > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org