公司用CORBA,要求JDK1.3,
研究出一点小技巧:
编译的时候如果使用JDK1.4,运行的时候使用JDK1.3,就会报UnsupportVersion的问题;
反之如果采用1.3编译,1.4运行,则OK。
编译的时候可以指定参数:

JDK版本问题    <compile>
JDK版本问题        
<debug value="true" />
JDK版本问题        
<deprecation value="true" />
JDK版本问题        
<jdk-version>
JDK版本问题            
<source value="1.3" />
JDK版本问题            
<target value="1.3" />
JDK版本问题        
</jdk-version>
JDK版本问题        
<optimize value="true" />
JDK版本问题    
</compile>


然后:
    <target name="compile" depends="init"
        description
="Compile source">
        
<mkdir dir="${dist}/classes" />
        
<javac debug="${compile.debug}"
            deprecation
="${compile.deprecation}" destdir="${dist}/classes"
            target
="${compile.jdk-version.target}"
            source
="${compile.jdk-version.source}" optimize="${compile.optimize}"
            srcdir
="${src}">
            
<classpath refid="compile.classpath" />
        
</javac>
    
</target>

相关文章: