| ant javac version question | ant javac version question 2006-12-11 - By Scot P. Floess
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@(protected)> 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@(protected)> 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@(protected) >> >> > For additional commands, e-mail: user-help@(protected) >> >> > >> >> > >> >> >> >> -- >> >> 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@(protected) >> >> For additional commands, e-mail: user-help@(protected) >> >> >> >> >> > >> >> -- >> 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@(protected) For additional commands, e-mail: user-help@(protected)
|
|
 |