ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "glenn opdycke-hansen" <glenn...@gmail.com>
Subject Re: ant javac version question
Date Wed, 13 Dec 2006 18:48:48 GMT
ok, how could we be getting jdk 1.5 java compile?
We removed (via control panel) the 1.5 jdk. could some file be lurking
in c:\winxp or other folder?

Below are parts of the log from the build:

PATH=D:\Software\Java\j2sdk1.4.2_13\bin;D:\Software\Perl\bin\;C:\CYGWIN\bin;D:\CVSNT;D:\Perl\bin;D:\apache-ant-1.6.5\bin;C:\PROGRA~1\Oracle\jre\1.1.8\bin;C:\WINXP\system32;C:\WINXP\System32\
...
ANT_HOME=D:\apache-ant-1.6.5
JAVA_HOME=D:\Software\Java\j2sdk1.4.2_13
Apache Ant version 1.6.5 compiled on June 2 2005
Buildfile: build.xml
Adding reference: ant.PropertyHelper
Detected Java version: 1.4 in: D:\Software\Java\j2sdk1.4.2_13\jre
Detected OS: Windows XP
...
    [javac] com\usbank\entdevsvc\mask\MaskPayload.java added as
com/usbank/entdevsvc/mask/MaskPayload.class doesn't exist.
    [javac] Compiling 1 source file to
K:\bxnaray_ssmcmn_1.0_dev\ssm_src\ssm_cmn\ems_maskpayload\classes
    [javac] Using modern compiler
fileset: Setup scanner in dir
K:\bxnaray_ssmcmn_1.0_dev\ssm_src\ssm_cmn\vendor\jar with patternSet{
includes: [*.jar] excludes: [] }
dropping K:\bxnaray_ssmcmn_1.0_dev\ssm_src\ssm_cmn\ems_maskpayload\C:\PROGRA~1\IBM\SQLLIB\ja
from path as it doesn't exist
    [javac] Compilation arguments:
    [javac] '-d'
    [javac] 'K:\bxnaray_ssmcmn_1.0_dev\ssm_src\ssm_cmn\ems_maskpayload\classes'
    [javac] '-classpath'
    [javac] 'K:\bxnaray_ssmcmn_1.0_dev\ssm_src\ssm_cmn\ems_maskpayload\classes;K:\bxnaray_ssmcmn_1.0_dev\ssm_src\ssm_cmn\vendor\jar\ContivoRuntime.jar;K:\bxnaray_ssmcmn_1.0_dev\ssm_src\ssm_c
...
    [javac] '-sourcepath'
    [javac] 'K:\bxnaray_ssmcmn_1.0_dev\ssm_src\ssm_cmn\ems_maskpayload\source'
    [javac] '-target'
    [javac] '1.4'
    [javac] '-g'
    [javac] '-verbose'
    [javac]
    [javac] The ' characters around the executable and arguments are
    [javac] not part of the command.
    [javac] File to be compiled:
    [javac]
K:\bxnaray_ssmcmn_1.0_dev\ssm_src\ssm_cmn\ems_maskpayload\source\com\usbank\entdevsvc\mask\MaskPayload.java
    [javac] [parsing started
K:\bxnaray_ssmcmn_1.0_dev\ssm_src\ssm_cmn\ems_maskpayload\source\com\usbank\entdevsvc\mask\MaskPayload.java]
    [javac] [parsing completed 63ms]
    [javac] [loading
D:\Software\Java\j2sdk1.4.2_13\jre\lib\rt.jar(java/io/IOException.class)]
    [javac] [loading
D:\Software\Java\j2sdk1.4.2_13\jre\lib\rt.jar(java/io/Serializable.class)]
...

I did notice an invalid entry in the PATH.
Should I check the CLASSPATH too?



On 12/11/06, Scot P. Floess <floess@mindspring.com> wrote:
> You can certainly specify which JDK to use in the <javac> task.
> However, that may not fix your runtime issue...if an older version of
> the JDK is used to run against it...
>
> Yes, specifying <target> may help...
>
> Again, you need to ensure the VM being used when running against the
> compiled class is the correct version (in your case I think that means a
> 1.4.2+ VM)...
>
> It looks to me like your code is being compiled using the JDK 1.5.0+  I
> just compiled some code and did a "javap -c -verbose" on a class
> file...  With the JDK 1.5.0_09 I get a minor = 0
> major = 49...  Compiling wiht "javac -source 1.2 release 1.2" I see the
> minor = 0 major = 46.
>
> My guess is the JDK being used during compilation is 1.5.0+.  As such,
> try doing the target = "1.4" ... You may also need to set  source = "1.4"
>
> HTH,
>
> Scot
>
> glenn opdycke-hansen wrote:
> > Right, I know that jdk 1.4.2 works.
> > I suspect that some other jdk version is creeping into the class/jar
> > file.
> > I specified JAVA_HOME for the 1.4.2 jdk. I also suggested to the
> > developer to change the path.  (I heard that that did not work)
> > java -version also states that 1.4.2 will be used.
> >
> > Is there some option/parm on the javac that will help with this?
> > Perhaps <target="1.4"> ?
> > Perhaps <compiler="modern"> ?
> > --glenn
> >
> > On 12/11/06, Scot P. Floess <floess@mindspring.com> wrote:
> >> Well there is your problem...the JVM you are trying to use to run (not
> >> compile) does not support the version that was compiled.
> >> Meaning...let's say you compiled using the JDK 1.5 but attempted to run
> >> using the JDK 1.2.2 - you'd get the error listed.
> >>
> >> Somehow you are compiling with a newer JDK but when running, you are
> >> getting some older version of the JDK.
> >>
> >> Make sure your path is correct and include this newer JDK...  You might
> >> want to put $JAVA_HOME/bin first in your path.  Or, on the command line
> >> type:
> >>
> >> java -version
> >>
> >> Either way its a JVM mismatch problem.
> >>
> >> glenn opdycke-hansen wrote:
> >> > Replies below.
> >> >
> >> > On 12/11/06, Scot P. Floess <floess@mindspring.com> wrote:
> >> >> What type of exceptions are you getting?
> >> >
> >> > java.lang.Exception: Error in
> >> > [ProcessDefinitions/Shared/Logging/MaskLogData.process/MaskPayload]
> >> > BW-JAVA-100030 Unable to obtain information for method
> >> > [maskElementsInPayload] from the class
> >> > [com.usbank.entdevsvc.mask.MaskPayload].  Exception occurred.
> >> > java.lang.UnsupportedClassVersionError:
> >> > com/usbank/entdevsvc/mask/MaskPayload (Unsupported major.minor version
> >> > 49.0)
> >> >
> >> >>
> >> >> If you use the class file outside the jar file...does that work?
> >> >
> >> > We have not tried that (yet).
> >> >
> >> >>
> >> >> Is your harddrive full?
> >> >
> >> > no
> >> >
> >> >>
> >> >> glenn opdycke-hansen wrote:
> >> >> > We are seeing that the javac can produce an unusable .class file.
> >> >> > One PC will build the java source OK, but the other PC does
> >> not.  The
> >> >> > resulting JAR file has a different size and there are exceptions
> >> when
> >> >> > the other jar is used.
> >> >> > We set JAVA_HOME to the jdk (1.4.2_13) on both PCs.
> >> >> >
> >> >> > Has anyone seen this?
> >> >> > Could it be due to differences in the PATH (winxp)?
> >> >> > Is there any way to check the version of the jdk/javac used?
> >> (-verbose
> >> >> > does not seem to provide enough info)
> >> >> >
> >> >> > Thanks,
> >> >> > --glenn
> >> >> >
> >> >> >
> >> ---------------------------------------------------------------------
> >> >> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> >> >> > For additional commands, e-mail: user-help@ant.apache.org
> >> >> >
> >> >> >
> >> >>
> >> >> --
> >> >> Scot P. Floess
> >> >> 27 Lake Royale
> >> >> Louisburg, NC  27549
> >> >>
> >> >> 252-478-8087 (Home)
> >> >> 919-754-4592 (Work)
> >> >>
> >> >> Chief Architect JPlate  http://sourceforge.net/projects/jplate
> >> >> Chief Architect JavaPIM http://sourceforge.net/projects/javapim
> >> >>
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> >> >> For additional commands, e-mail: user-help@ant.apache.org
> >> >>
> >> >>
> >> >
> >>
> >> --
> >> Scot P. Floess
> >> 27 Lake Royale
> >> Louisburg, NC  27549
> >>
> >> 252-478-8087 (Home)
> >> 919-754-4592 (Work)
> >>
> >> Chief Architect JPlate  http://sourceforge.net/projects/jplate
> >> Chief Architect JavaPIM http://sourceforge.net/projects/javapim
> >>
> >>
> >
>
> --
> Scot P. Floess
> 27 Lake Royale
> Louisburg, NC  27549
>
> 252-478-8087 (Home)
> 919-754-4592 (Work)
>
> Chief Architect JPlate  http://sourceforge.net/projects/jplate
> Chief Architect JavaPIM http://sourceforge.net/projects/javapim
>
>

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


Mime
View raw message