当前位置: 首页 > 知识库问答 >
问题:

如何在Centos中为Apache Tomcat设置JAVA_HOME?

姬俊能
2023-03-14
    E325: ATTENTION
    Found a swap file by the name "/etc/profile.d/.java.sh.swp"
              owned by: root   dated: Thu Oct 19 14:21:28 2017
             file name: /etc/profile.d/java.sh
              modified: YES
             user name: root   host name: rtp
            process ID: 31766
    While opening file "/etc/profile.d/java.sh"
    
    (1) Another program may be editing the same file.  If this is the case,
        be careful not to end up with two different instances of the same
        file when making changes.  Quit, or continue with caution.
    (2) An edit session for this file crashed.
        If this is the case, use ":recover" or "vim -r /etc/profile.d/java.sh"
        to recover the changes (see ":help recovery").
        If you did this already, delete the swap file "/etc/profile.d/.java.sh.swp"
        to avoid this message.
    
    Swap file "/etc/profile.d/.java.sh.swp" already exists!
    [O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:
    export JAVA_HOME=/usr/bin/java/java-1.8.0-openjdk.x86_64 
    export PATH=$PATH:$JAVA_HOME/bin
    export CLASSPATH=$JAVA_HOME/jre/lib/ext:$JAVA_HOME/lib/tools.jar

我又不明白该怎么办了。我已经重复了两天了。拜托,有什么帮忙吗?

共有1个答案

祝俊
2023-03-14
export JAVA_HOME=/usr/bin/java/java-1.8.0-openjdk.x86_64 
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=$JAVA_HOME/jre/lib/ext:$JAVA_HOME/lib/tools.jar
 类似资料:
  • 问题内容: 我需要将docker设置为在运行Amazon Linux(centos)的主机上侦听tcp://0.0.0.0/4243。我看过的所有文档都告诉我运行以下命令 它将正确的docker_opts写入/ etc / default / docker。我已经做到了,但是当我重新启动docker时,它不会监听127.0.0.1 我可以通过键入以下命令使docker正确运行 那行得通,但是我希望

  • 问题内容: 有没有办法将CentOS 7上的Python 3.5.2设置为默认的Python版本?目前,我已经默认安装了Python 2.7和Python 3.5.2。 我使用了以下命令 但是之后给出了错误。 问题答案: 如果这 不起作用(应该) 您可以使用以下命令在您的计算机中添加一个别名: 如果这不起作用,则应该只使用虚拟环境。阅读此页以开始使用。

  • 本文向大家介绍如何在CentOS 7上为Apache配置mod_rewrite,包括了如何在CentOS 7上为Apache配置mod_rewrite的使用技巧和注意事项,需要的朋友参考一下 在本文中,我们将学习如何在CentOS 7上为Apache配置mod_rewrite,Apache是一种非常流行的Web服务器,它允许我们自定义和启用其功能并禁用它们。如果现在需要更多资源,则Apache管理

  • 修改官方源 下面内容的一个简易集合版本脚本:http://pan.baidu.com/s/1hrdnbi0 修改官方源 国内常用源配置方法(该源和官方源是一样的,只是因为服务器在国内会起到加速作用而已): 163 源:http://mirrors.163.com/.help/centos.html 阿里源:http://mirrors.aliyun.com/help/centos sohu:htt

  • 本文向大家介绍如何在Mac OS中为Java设置JAVA_HOME?,包括了如何在Mac OS中为Java设置JAVA_HOME?的使用技巧和注意事项,需要的朋友参考一下 假设您已将Java安装在 \ usr \ local \ java \ jdk目录中- 如果使用bash作为外壳,则可以将以下行添加到'.bashrc的末尾:export JAVA_HOME = \ usr \ local \

  • 问题内容: 我可以如下设置Firefox的代理设置。 但是我也需要设置Chrome。.有人可以帮助我怎么做吗? 谢谢拉吉 问题答案: 您可以尝试使用该类,如下所示: