shibboleth-dev - RE: javac -target
Subject: Shibboleth Developers
List archive
- From: "Howard Gilbert" <>
- To: "'Shibboleth Development'" <>
- Subject: RE: javac -target
- Date: Wed, 4 May 2005 07:52:29 -0400
The target="1.4" is specified correctly and is necessary. If not specified,
then if the source is compiled with a JDK 1.5 compiler it will produce class
files that do not run on a 1.4 system. If a compiler is generating incorrect
output, or a runtime is not running the files, then this is an error in the
compiler or runtime. Although you are certainly free to remove this option
for your own compiles, because locally you can ensure consistent levels of
Java, it would be a source of errors if they were removed from the official
build process. We would just end up with a long string of "unsupported
major.minor version 49.0" error complaints.
Historical note: Each new version of JDK updates the class file format
specification. Through 1.3, javac defaulted to use the oldest format and
would only generate new formats when requested. Starting with 1.4, javac now
generates the latest format, but if you are not using new language features
it will generate an older format on request. The "-source" may not be later
than the "-target", but the "-target" can be later than the "-source"
(although nobody has ever suggested a reason why anyone would want to use
this feature). Source "1.4" permits assert statements but does not permit
the new Tiger features. Target "1.4" produces class files that run on a 1.4
runtime or later.
Since this suggests a bug in the JDK, the obvious question is what version
of the JDK is doing the compile and what version of JDK/JRE is running when
the message displays. If it is not latest (1.4.2_08 or 1.5.0_03) then
upgrade to see if the bug is fixed.
> -----Original Message-----
> The following ant task will be found in the shib build file:
>
> <javac srcdir="${src}" destdir="${build}" includes="**/*.java"
> debug="on"
> target="1.4" source="1.4">
> <classpath refid="build.path" />
> </javac>
>
> Although not conclusive, experiments seem to indicate that the -target
> option is responsible for the following wierd error:
>
> java.lang.ClassFormatError: Illegal field name "has inconsistent
> hierarchy" in
> class
> edu/uiuc/ncsa/shibboleth/plugins/X509SubjectNameNameIdentifierMapping
> java.lang.ClassLoader.defineClass1(Native Method)
- javac -target, Tom Scavo, 05/03/2005
- RE: javac -target, Howard Gilbert, 05/04/2005
- Re: javac -target, Tom Scavo, 05/04/2005
- RE: javac -target, Howard Gilbert, 05/04/2005
- RE: javac -target, Scott Cantor, 05/04/2005
- Re: javac -target, Tom Scavo, 05/04/2005
- RE: javac -target, Howard Gilbert, 05/04/2005
Archive powered by MHonArc 2.6.16.