Use the features of jdk5.0 on jdk1.0.

Source: Internet
Author: User

Author: Jiangnan Baiyi

Source and discussion: http://www.blogjava.net/calvin/archive/2006/01/13/27913.html

A stable development team generally does not upgrade the JDK of the project at will, but those who buy WebLogic with real money do not support JDK or earlier, so they will not be upgraded. Then, looking at ejb3, spring 2 constantly has new features related to annotation, and its own system architecture can only be moved.
Springside has decided to stick to jdk1.4 for the purpose of its applicability, but it suddenly finds that the good Weaver can obtain the syntax features of annotation, model, and autoboxing on jdk1.4. Introduction articles include:
Jetbrains idea Chinese: Weaver Introduction
Ibm dw: classworking Toolkit: j2se 5.0 features are used on the old JVM version
James Strachan's Weblog

I was worried that the open-source project was not reliable, but jetbrains idea had already endorsed it and used it to gradually upgrade idea code to jdk5.0 and still run on jdk1.4.

Unlike jarkarta common atrributes and backport175 support annotation in the jdk1.4 syntax, Weaver allows you to directly use jdk5.0 for development and then convert it back to jdk1.3 at the byte code level, 1.4 supported commands.

In addition, IDEA provides a plug-in to transparently integrate the conversion action.

Typical Application Scenario 1: A class library is compiled with jdk5. it cannot be run on jdk1.4.

Today's functionalj is the case.
I unwrapped the jar package and used the built-in GUI of Weaver to convert the class file and package it again. The package runs successfully !!!

Typical Application Scenario 2: Use the annotation and autoboxing features of spring 2.0 and drools in the project
Set the JDK of the project to 5.0 and use the above features under JDK. After compilation, use the command line and ant script to downgrade the class file to JDK and JDK.
If you use idea, the plug-in can perform this step transparently.

Note:: Weaver supports the new syntax feature of jdk5.0, while the new API of jdk5.0 is not packaged.
Thanks to idea's plug-in, can you remind me if you have used APIs that exceed the target JDK.
If your goal is to use spring Annotation on jdk1.4, this is not a problem.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.