Unsupported major.minor version 49.0

后端 未结 6 1850
庸人自扰
庸人自扰 2020-12-01 15:20

I am getting the following exception whenever I login to my application ...

javax.servlet.ServletException: com/sun/org/apache/xalan/internal/xsltc/

相关标签:
6条回答
  • 2020-12-01 15:36

    You have some code compiled with Java 5 features that you're trying to run on a 1.4 or earlier JVM. Check your JAVA_HOME variable is pointing at a 1.5 or later JDK.

    Update: In your comment you say you are using WAS 5.1. WAS 5.1 doesn't support Java 5, from memory you need to be on WAS 6.1 to use Java 5 (looking for reference...)

    0 讨论(0)
  • 2020-12-01 15:36

    This happens when you have compiled your code in a machine that uses a different JDK version to the one you end up running the code in. Make sure you use the same JDK version in these different boxes.

    0 讨论(0)
  • 2020-12-01 15:36

    Use sudo update-alternatives --config java and set the version you may want to use.

    0 讨论(0)
  • 2020-12-01 15:38

    Your code was compiled with Java 1.5 and your trying to run it with Java 1.4 ( or lower )

    The solution is

    a) Run it with Java1.5 ( perhaps using WAS 6+ ) 
    b) Recompile it with Java 1.4
    

    or

    c) Recompile it with Java.15 but specifying the -target flag ( javac -target 1.4 .... ) 
    

    The point is, you are trying to run 1.5 bytecode in a 1.4 vm

    0 讨论(0)
  • 2020-12-01 15:51

    You have a mismatch between your JVM that you're using to run the .class, and the version of Java used to compile the .class. The JVM running it is an earlier version of the JVM used to compile that class.

    As detailed here, you have a version 1.5 class that you're trying to run on an earlier JVM.

    EDIT : WAS 5.1 uses JDK 1.4, it would appear.

    0 讨论(0)
  • If you do build your classes with a higher version of the JDK for a minor version of JAVA use the -source and -target switches of the javac compiler. Some customers do need a minor version of Java, e.g. 1.4, while you're developing with 1.6. -source and -target are is remedy for this szenario. You might read the very good paper about byte code vs. source code versioning issues from Alex Buckley.

    But since TransformerFactoryImpl is a Sun internal class, check your JAVA_HOME for your container, ut this is container specific.

    0 讨论(0)
提交回复
热议问题