Tomcat6和Java 7

编程入门 行业动态 更新时间:2024-10-10 01:21:20
本文介绍了Tomcat6和Java 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在linux中,是否可以在tomcat6上部署使用Java 7编写的Web应用程序?如果是这样,需要修改哪些配置才能使其正常工作?

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?

我试过更改 JAVA_HOME 变量在 tomcat6.conf 文件中并重新启动,但根据tomcat管理器网页仍然使用1.6,并且只有1.6或更低版本的应用程序正确部署。

I have tried changing the JAVA_HOME variable in the tomcat6.conf file and restarting, but it is still using 1.6 according to the tomcat manager webpage, and only applications written in 1.6 or lower deploy correctly.

我在不同地点安装了jdk 1.6和1.7。

I have both jdk 1.6 and 1.7 installed in different locations.

推荐答案

我有当我使用Java JDK 1.7.0编译我的servlet时,一个主要问题是Tomcat由于运行时manor.major版本错误而无法启动。

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.

使Tomcat6运行使用JDK 1.7的类执行以下操作:

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

  • 打开文件 /etc/init.d/具有root权限的tomcat6 。

    您将找到一个名为 JDK_DIRS 的变量第83行。

    You will find a variable called JDK_DIRS at line 83.

    通过在行的开头添加#来评论它。

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

    写下来wing bellow it: JDK_DIRS =/ usr / lib / jvm / java-1.7.0-openjdk-i386

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

    保存并重新启动tomcat

    Save and restart tomcat

  • 更多推荐

    Tomcat6和Java 7

    本文发布于:2023-11-25 20:19:44,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1631214.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:Java

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!