报错:

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环境的更多相关文章

  1. Linux系统下启动tomcat报错【java.util.prefs.BackingStoreException: Couldn't get file lock】的解决方法

    Linux环境下,启动tomcat报出如题的警告信息,虽然对系统正常使用没有多大影响,但是会导致tomcat的日志垃圾信息很多,而且看起来很不爽... 具体的警告信息如下: Jan , :: PM j ...

  2. 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 ...

  3. maven 项目启动tomcat报错 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

    maven项目启动tomcat报错: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderLi ...

  4. eclipse使用maven,启动工程tomcat报错:java.lang.ClassNotFoundException: org.springframework.web.context.Contex

    maven是个不错的管理jar包工具,但是我们在eclipse使用maven时,总是遇上这样那样的问题,比如今天,我编译工程,启动过后,tomcat报错:java.lang.ClassNotFound ...

  5. 【转】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 ...

  6. IDEA启动Tomcat报错1099 is already in use

    IDEA中启动Tomcat报错,Error running Tomcat7.0.52: Address localhost:1099 is already in use 或者是 java.rmi.se ...

  7. tomcat报错:java.net.SocketException: Permission denied["http-nio-80"]

    tomcat报错:java.net.SocketException: Permission denied["http-nio-80"] 问题:使用非root账户tomcat启动to ...

  8. mysql-connector-java升级到6.0以后启动tomcat报错

    mysql-connector-java升级到6.0以后启动tomcat报错 java.sql.SQLException: The server time zone value '�й���׼ʱ��' ...

  9. IDEA启动Tomcat报错

    Maven编译成功, 可是启动Tomcat报错: Application Server was not connected before run configuration stop, reason: ...

随机推荐

  1. 常见IT英语单词

    lable标签,master精通.主人,reference参考,release发布,schema模式,component组件,persistence持久化,generate生成产生,plugin插件, ...

  2. jenkins学习笔记

    Jenkins 是一款流行的开源持续集成(Continuous Integration)工具,广泛用于项目开发,具有自动化构建.测试和部署等功能.本系列博客以 windows 10 环境为例 1 安装 ...

  3. HDU3629:Convex

    传送门 求凸四边形的个数 转化成总数减去凹四边形的个数 凹四边形一定是一个三角形中间包含的另外一个点 那么枚举被包含的点,其它的对于这个点极角排序 被包含不好算,算总数减去不被包含的 枚举三角形的一个 ...

  4. Vue2实践揭秘 - 书,读后作了一个简单摘要

    jd上买了本实践相关的, 看过后,的确是实践项目后的一些分享,有些网上的一些vue2教程没怎么提及 ----------- 看完了,有些启发,作了个简单摘要作记录, 对vue2感兴趣的,可以自己网上搜 ...

  5. LeetCode算法题5----Longest Palindromic Substring

    #5. Longest Palindromic Substring Given a string S, find the longest palindromic substring in S. You ...

  6. Storm-Concept

    1. Storm集群架构          strom jar all-your-code.jar backtype.storm.MyWordCounterTopology arg1 arg2 这个命 ...

  7. 最好的原型和流程图绘制工具:OmniGraffle_交互设计

    原文地址:http://www.shangxueba.com/jingyan/2230668.html 使用哪种原型设计工具"大概是设计师闲聊时出现频率最高的话题之一.据我了解一般以Visi ...

  8. No value specified for 'Date'错误

    今天使用 BeanUtils.copyProperties(m,n);  遇到  No value specified for 'Date'  这个错误,以前用的时候都不需要加 try 今天使用发现需 ...

  9. 转:Java Socket编程

    对于Java Socket编程而言,有两个概念,一个是ServerSocket,一个是Socket.服务端和客户端之间通过Socket建立连接,之后它们就可以进行通信了.首先ServerSocket将 ...

  10. 深入理解HashMap和concurrentHashMap

    原文链接:https://segmentfault.com/a/1190000015726870 前言 Map 这样的 Key Value 在软件开发中是非常经典的结构,常用于在内存中存放数据. 本篇 ...