gpt4 book ai didi

java - OS X Mavericks 上的 Tomcat 安装问题

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:08:50 25 4
gpt4 key购买 nike

在 OS X Mavericks 上安装 Tomcat 的问题

我无法启动服务器,因为它没有启动:

/opt/apache-tomcat-8.0.12/bin/catalina.sh: line 399: /opt/apache-tomcat-8.0.12/logs/catalina.out: No such file or directory

SEICCN-3:Downloads stefanieness$ /opt/apache-tomcat-8*/bin/startup.sh
Using CATALINA_BASE: /opt/apache-tomcat-8.0.12
Using CATALINA_HOME: /opt/apache-tomcat-8.0.12
Using CATALINA_TMPDIR: /opt/apache-tomcat-8.0.12/temp
Using JRE_HOME: /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home
Using CLASSPATH: /opt/apache-tomcat-8.0.12/bin/bootstrap.jar:/opt/apache-tomcat-8.0.12/bin/tomcat-juli.jar
touch: /opt/apache-tomcat-8.0.12/logs/catalina.out: No such file or directory
/opt/apache-tomcat-8.0.12/bin/catalina.sh: line 399: /opt/apache-tomcat-8.0.12/logs/catalina.out: No such file or directory
SEICCN-3:Downloads stefanieness$ $CATALINA_HOME/bin/startup.sh
-bash: /bin/startup.sh: No such file or directory

Apache Tomcat 安装:

  1. tutorialforlinux.com/2014/01/10/how-to-install-apache-tomcat-8-on-mac-10-9-mavericks-os-x-easy-visual-guide/

    SEICCN-3:assignment1 stefanieness$ sudo mkdir /opt
    Password:
    mkdir: /opt: File exists
    SEICCN-3:assignment1 stefanieness$ sudo mv /Users/stefanieness/Downloads/apache-tomcat-8* /opt/
    SEICCN-3:assignment1 stefanieness$ /opt/apache-tomcat-8*/bin/startup.sh
    Using CATALINA_BASE: /opt/apache-tomcat-8.0.12
    Using CATALINA_HOME: /opt/apache-tomcat-8.0.12
    Using CATALINA_TMPDIR: /opt/apache-tomcat-8.0.12/temp
    Using JRE_HOME: /Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home
    Using CLASSPATH: /opt/apache-tomcat-8.0.12/bin/bootstrap.jar:/opt/apache-tomcat-8.0.12/bin/tomcat-juli.jar
    touch: /opt/apache-tomcat-8.0.12/logs/catalina.out: No such file or directory
    /opt/apache-tomcat-8.0.12/bin/catalina.sh: line 399: /opt/apache-tomcat-8.0.12/logs/catalina.out: No such file or directory
  2. tutorialforlinux.com/2014/01/09/how-to-install-oracle-jdk-7-on-mac-10-9-mavericks-easy-guide/

按照教程操作。

SEICCN-3:assignment1 stefanieness$ java -version
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
  1. 错误:
sudo mv /Users/stefanieness/Downloads/apache-tomcat-8* /opt/
mv: rename /Users/stefanieness/Downloads/apache-tomcat-8.0.12 to /opt/apache-tomcat-8.0.12: Directory not empty
  1. 遵循教程:wolfpaulus.com/jounal/mac/java-tomcat-resteasy/
SEICCN-3:assignment1 stefanieness$ sudo mkdir /opt
Password:
mkdir: /opt: File exists
SEICCN-3:assignment1 stefanieness$ sudo mv /Users/<myUser>/Downloads/apache-tomcat-8* /opt/
-bash: myUser: No such file or directory
SEICCN-3:assignment1 stefanieness$ sudo mv /Users/stefanieness/Downloads/apache-tomcat-8* /opt/
mv: rename /Users/stefanieness/Downloads/apache-tomcat-8.0.12 to /opt/apache-tomcat-8.0.12: Directory not empty
SEICCN-3:assignment1 stefanieness$ cd ~/Downloads/
SEICCN-3:Downloads stefanieness$ tar -zxvf ./apache-tomcat-8.0.12.tar.gz
tar: Error opening archive: Failed to open './apache-tomcat-8.0.12.tar.gz'
SEICCN-3:Downloads stefanieness$ sudo mkdir -p /usr/local
Password:
SEICCN-3:Downloads stefanieness$ sudo mv ~/Downloads/apache-tomcat-8* /usr/local
SEICCN-3:Downloads stefanieness$ sudo rm -f /Library/Tomcat
SEICCN-3:Downloads stefanieness$ sudo ln -s /usr/local/apache-tomcat-8* /Library/Tomcat
SEICCN-3:Downloads stefanieness$ sudo chown -R stefanieness/Library/Tomcat
usage: chown [-fhv] [-R [-H | -L | -P]] owner[:group] file ...
chown [-fhv] [-R [-H | -L | -P]] :group file ...
SEICCN-3:Downloads stefanieness$ sudo chmod +x /Library/Tomcat/bin/*.sh
SEICCN-3:Downloads stefanieness$ /opt/apache-tomcat-8*/bin/startup.sh
Using CATALINA_BASE: /opt/apache-tomcat-8.0.12
Using CATALINA_HOME: /opt/apache-tomcat-8.0.12
Using CATALINA_TMPDIR: /opt/apache-tomcat-8.0.12/temp
Using JRE_HOME: /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home
Using CLASSPATH: /opt/apache-tomcat-8.0.12/bin/bootstrap.jar:/opt/apache-tomcat-8.0.12/bin/tomcat-juli.jar
touch: /opt/apache-tomcat-8.0.12/logs/catalina.out: No such file or directory
/opt/apache-tomcat-8.0.12/bin/catalina.sh: line 399: /opt/apache-tomcat-8.0.12/logs/catalina.out: No such file or directory
SEICCN-3:Downloads stefanieness$ cd /Users/stefanieness/tomcat/bin
-bash: cd: /Users/stefanieness/tomcat/bin: No such file or directory

Other tutorials that I found:
editrocket.com/articles/tomcat_mac.html
Starting the server this way does not work.

有人知道好的教程吗?我该怎么做?

最佳答案

看起来您至少遗漏了两件事。首先,创建日志目录(-p 创建路径中的每个目录,如果存在则不报错):

mkdir -p /opt/apache-tomcat-8.0.12/logs

此外,对于@wrongAnswer 的观点,您需要在启动 tomcat 之前在命令行上运行,或者放入配置文件或 rc 脚本:

env CATALINA_HOME=/opt/apache-tomcat-8.0.12 /opt/apache-tomcat-8.0.12/bin/catalina.sh jpda start

希望这对您有所帮助。

关于java - OS X Mavericks 上的 Tomcat 安装问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26022614/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com