sudo 启动tomcat报错没有java环境
报错:
Cannot find ./catalina.sh
The file is absent or does not have execute permission
This file is needed to run this program
原因:
没有给bin目录下的文件授权可执行权限:
解决方法:
chmod +x bin/*.sh
报错Neither the JAVA_HOME nor the JRE_HOME environment variable is defined:
解决方法如下:
tomcat启动脚本文件: startup.sh, startup.sh会加载 catalina.sh , catalina.sh会加载setclasspath.sh
Linux: export JAVA_HOME=绝对路径 Windows: set
可以直接添加到第二行:
#!/bin/sh
export JAVA_HOME=/usr/local/java1.8
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
成功
[root@hadoop1 apache-tomcat-8.0.43]# sudo bin/startup.sh
/home/report/apache-tomcat-8.0.43/bin/catalina.sh:行143: -Xmx1024m: 未找到命令
Using CATALINA_BASE: /home/report/apache-tomcat-8.0.43
Using CATALINA_HOME: /home/report/apache-tomcat-8.0.43
Using CATALINA_TMPDIR: /home/report/apache-tomcat-8.0.43/temp
Using JRE_HOME: /home/jdk-10.0.1
Using CLASSPATH: /home/report/apache-tomcat-8.0.43/bin/bootstrap.jar:/home/report/apache-tomcat-8.0.43/bin/tomcat-juli.jar
Tomcat started.
以上是在catalina.sh文件中添加的。依然存在问题,就是关闭指令运行报错 shutdown.sh
[root@hadoop1 apache-tomcat-8.0.43]# sudo bin/shutdown.sh
/home/report/apache-tomcat-8.0.43/bin/catalina.sh:行143: -Xmx1024m: 未找到命令
Using CATALINA_BASE: /home/report/apache-tomcat-8.0.43
Using CATALINA_HOME: /home/report/apache-tomcat-8.0.43
Using CATALINA_TMPDIR: /home/report/apache-tomcat-8.0.43/temp
Using JRE_HOME: /home/jdk-10.0.1
Using CLASSPATH: /home/report/apache-tomcat-8.0.43/bin/bootstrap.jar:/home/report/apache-tomcat-8.0.43/bin/tomcat-juli.jar./catalina.sh: 1: eval: usrjjdk-10.0.1re/bin/java: not found
还是显示找不到,而且路径 usrjdk-10.0.1jre莫名奇妙少了 '/' 。
解决方法:
把刚刚修改的 export JAVA_HOME环境变量改写到 setclasspath.sh里面,把原先的 catalina.sh export那个删除掉
成功解决:
[root@hadoop1 apache-tomcat-8.0.43]# sudo bin/shutdown.sh
/home/report/apache-tomcat-8.0.43/bin/catalina.sh:行143: -Xmx1024m: 未找到命令
Using CATALINA_BASE: /home/report/apache-tomcat-8.0.43
Using CATALINA_HOME: /home/report/apache-tomcat-8.0.43
Using CATALINA_TMPDIR: /home/report/apache-tomcat-8.0.43/temp
Using JRE_HOME: /home/jdk-10.0.1
Using CLASSPATH: /home/report/apache-tomcat-8.0.43/bin/bootstrap.jar:/home/report/apache-tomcat-8.0.43/bin/tomcat-juli.jar
sudo 启动tomcat报错没有java环境的更多相关文章
- Linux系统下启动tomcat报错【java.util.prefs.BackingStoreException: Couldn't get file lock】的解决方法
Linux环境下,启动tomcat报出如题的警告信息,虽然对系统正常使用没有多大影响,但是会导致tomcat的日志垃圾信息很多,而且看起来很不爽... 具体的警告信息如下: Jan , :: PM j ...
- IDEA启动tomcat报错:java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext、ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component
先看错误日志: -May- ::.M26 -May- :: :: UTC -May- ::29.845 信息 [main] org.apache.catalina.startup.VersionLog ...
- maven 项目启动tomcat报错 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
maven项目启动tomcat报错: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderLi ...
- eclipse使用maven,启动工程tomcat报错:java.lang.ClassNotFoundException: org.springframework.web.context.Contex
maven是个不错的管理jar包工具,但是我们在eclipse使用maven时,总是遇上这样那样的问题,比如今天,我编译工程,启动过后,tomcat报错:java.lang.ClassNotFound ...
- 【转】Eclipse下启动tomcat报错:/bin/bootstrap.jar which is referenced by the classpath, does not exist.
转载地址:http://blog.csdn.net/jnqqls/article/details/8946964 1.错误: 在Eclipse下启动tomcat的时候,报错为:Eclipse下启动to ...
- IDEA启动Tomcat报错1099 is already in use
IDEA中启动Tomcat报错,Error running Tomcat7.0.52: Address localhost:1099 is already in use 或者是 java.rmi.se ...
- tomcat报错:java.net.SocketException: Permission denied["http-nio-80"]
tomcat报错:java.net.SocketException: Permission denied["http-nio-80"] 问题:使用非root账户tomcat启动to ...
- mysql-connector-java升级到6.0以后启动tomcat报错
mysql-connector-java升级到6.0以后启动tomcat报错 java.sql.SQLException: The server time zone value '�й���ʱ��' ...
- IDEA启动Tomcat报错
Maven编译成功, 可是启动Tomcat报错: Application Server was not connected before run configuration stop, reason: ...
随机推荐
- Java 集合:List(ArrayList,LinkedList)
- Code Signal_练习题_alternatingSums
Several people are standing in a row and need to be divided into two teams. The first person goes in ...
- 停课+2week
可真是,累啊. 本以为停课之后会轻松一点,结果天天好累的说... 今天开始得去锻炼锻炼了... 已经好几次突然一阵晕眩了qwq... 希望我还能挺得住吧,至少要挺到WC结束啊... 这次,可是关系到我 ...
- Week1——JavaEE
本科目标 首先,对我来说自己想走的方向是JavaWeb后台开发,因此JavaEE对我来说也是比较重要的,想学好这门课.进一步巩固自己现有的基础知识,完善自己的项目经验,更加熟悉开发流程.在框架方面我还 ...
- mysql中int、bigint、smallint 和 tinyint的区别与长度的含义【转】
最近使用mysql数据库的时候遇到了多种数字的类型,主要有int,bigint,smallint和tinyint.其中比较迷惑的是int和smallint的差别.今天就在网上仔细找了找,找到如下内容, ...
- .net core系列之《对AOP思想的理解及使用AspectCore实现自定义日志拦截》
对于AOP这个名词,相信对于搞过MVC开发的人来说,都很熟悉,里面各种各样的Filter简直是将AOP体现到了极致. 那么什么是AOP呢? AOP(Aspect Oriented Programmin ...
- Excel工资表
- Web Service超限
问题现状: {System.ServiceModel.CommunicationException: An error occurred while receiving the HTTP respon ...
- December 18th 2016 Week 52nd Sunday
May your love soar on the wings of a dove in flight. 愿你的爱乘着飞翔中的白鸽,展翅高飞. May my life soar on the wing ...
- [COGS 2066]七十和十七
2066. 七十和十七 ★★★ 输入文件:xvii.in 输出文件:xvii.out 简单对比时间限制:1 s 内存限制:256 MB [题目描述] 七十君最近爱上了排序算法,于是Ta ...