Tomcat6 and Java 7

后端 未结 4 943
别跟我提以往
别跟我提以往 2020-12-09 05:59

In linux, is it possible to have a web application written using Java 7 be deployed on tomcat6? If so, what configuration needs to be modified to allow it to work?

I

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-09 06:32

    I had a major problem when I compiled my servlet using java JDK 1.7.0, Tomcat wouldn't start up due of a runtime manor.major version error.

    To make Tomcat6 run your classes using JDK 1.7 do the following:

    1. Open the file /etc/init.d/tomcat6 with root privilege.

    2. You will find a variable called JDK_DIRS at line 83.

    3. Comment it out by adding # at the beginning of the line.

    4. Write the following bellow it: JDK_DIRS="/usr/lib/jvm/java-1.7.0-openjdk-i386"

    5. Save and restart tomcat

提交回复
热议问题