It is 48, and the 49jdk version is incompatible (unsupported Major. Minor version 49.0)

Source: Internet
Author: User
Tags unsupported
It's 48, and the 49jdk version is incompatible (unsupported Major. Minor version 49.0) (Series 1). Thank you very much for reading this article. If you think it is good or helpful, please Actively send a messageTo show encouragement.

With the upgrade of JDK, especially to JDK, we often encounter two kinds of embarrassment in Java programs:
1 unsupported Major. Minor version 49.0
2. The current version is 49.0, and 48.0 is required (this is probably the meaning)

The first scenario is encountered in both Java and Web applications.
In the second case, I encountered a problem in a web application.

Problem Analysis:
Is the internal version number of the Java compiler. 48 indicates that the program is compiled and run using JDK, and 49 indicates that the program is compiled and run using JDK.

Solution:

  • Method 1

    • Method: Use JDK again and run it in the jdk1.4 environment (including the JDK used for java_home, path, classpath, and tomcat;
    • Effect: the Java application is feasible; the web application fails.
  • Method 2
    • Method: Use JDK for compilation and run it under JDK (including modifying java_home, path, classpath, and JDK used by Tomcat)
    • Effect: Java applications are feasible; web applications are acceptable.

Two special supplements to method 2

  • Special Note 1:

If method 2 is used, that is, JDK 5.5, the tomcat version must not be lower *. The problem is, what if I need Tomcat earlier than 5.5?
The answer is: overwrite the tools. Jar under the lib directory of JDK to the tools. Jar directory under the/common/lib installation directory of Tomcat, and restart tomcat.

  • NOTE 2:

If you select the eclipse + myeclipse development environment and you choose to start Tomcat under eclipse, remember to be sure to go to The perference dialog box popped up by the preference option in the Windows menu, select myeclipse -- Application Server -- tomcat5 --- JDK and set JDK to 5.0.

Did you fix the problem in IDE?
If there is still a problem with the tomcat5.0 series, please follow Series 2 http://www.blogjava.net/crazycy/archive/2006/06/03/50150.html

The unlucky child, after reading the first article in this series, have you done it ?!

It is estimated that many people still cannot; but there is absolutely no problem in the IDE environment;

However, if you leave IDE (JBuilder, eclipse + myeclipse) and run it only in Tomcat, it still doesn't work, isn't it ?! Don't ask if the atat5.0 series does not support jdk1.5. I already told you how to do it in the first article, but why not ?! Someone even installed and uninstalled jdk1.4 jdk1.5 several times. Sorry, let's cry together. I also encountered this problem.

After a great pause, We will summarize the following:
It only runs in Tomcat, but "unsupported Major. Minor version 49.0" still appears. It took me about 120 minutes:
1. Check the displayed JDK version for Java-version.
2. if the version is 1.5 but cannot run, verify the following two points:
* Do you want to follow the format taught in the first article? (if not, I will summarize it in vain, Ah)
* View the registry and modify the JRE and JVM paths of 1.4 under the Registry HKEY_LOCAL_MACHINE/software/kerberoft to JDK of 1.5.

Probably not.
Why? Because you have specified the JRE when installing the tomcat5.0 series, do you think it is okay to modify the environment variables?

This is not the case. You enter the installation directory of tomcat5.0. there is no tomcat5w.exe file under the bind. You can open it and check the Java tag items.

What is the Java Virtual Machine option? Not jdk1.5.
What are you waiting ?! Modify it, and then start drinking champagne to celebrate the relief.

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.