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.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory
前言:项目在 spring-mvc.xml 文件中配置了上传文件拦截,结果启动报错 java.lang.NoClassDefFoundError: org/apache/commons/fileupl ...
- Oracle数据库基本操作(一) —— Oracle数据库体系结构介绍、DDL、DCL、DML
一.Oracle数据库介绍 1.基本介绍 Oracle数据库系统是美国ORACLE公司(甲骨文)提供的以分布式数据库为核心的一组软件产品,是目前最流行的客户/服务器(CLIENT/SERVER)或B/ ...
- 《JavaWeb从入门到改行》多重外键关系在java中的处理方案
目录:(点击红色方框展开子目录) 问题描述 无 项目案例说明 业务描述 数据库说明 项目源码及下载 无 问题描述 如上两图,数据库中各个表之间有很多的外键关系,其中业务关系是一个用户下有该用户的订单, ...
- 关于iFrame特性总计和iFrame跨域解决办法
1.iframe 定义和用法 iframe 元素会创建包含另外一个文档的内联框架(即行内框架). HTML 与 XHTML 之间的差异 在 HTML 4.1 Strict DTD 和 XHTML 1. ...
- 第三天-基本数据类型 int bool str
# python基础数据类型 # 1. int 整数 # 2.str 字符串.不会用字符串保存大量的数据 # 3.bool 布尔值. True, False # 4.list 列表(重点) 存放大量的 ...
- 如何面试Web前端开发
分享一篇HR前端面试心得: 面试前端工程师对我来说是一件非常有意思的事,因为面试过程很大程度上也是自我提升的过程.无论大公司还是小公司,之所以在如何招聘到真正有能力的,前端工程师方面会遇到同样的问题. ...
- 关系型数据库——主键&外键的
一.什么是主键.外键: 关系型数据库中的一条记录中有若干个属性,若其中某一个属性组(注意是组)能唯一标识一条记录,该属性组就可以成为一个主键 比如 学生表(学号,姓名,性别,班级) 其中每个学 ...
- jquery操作select(选中,取值)
最近工作中总出现select 和 option问题,整理一下,内容大部分源于网络资料 一.基础取值问题 例如<select class="selector"></ ...
- Cloud Computing Causing Digital Business Transformation
2015-04-13 Cloud Computing Causing Digital Business Transformation We hear all about the cloud, and ...
- 网络虚拟化技术 -- LXC TUN/TAP MACVLAN MACVTAP
Linux的网络虚拟化是LXC项目中的一个子项目,LXC包括文件系统虚拟化,进程空间虚拟化,用户虚拟化,网络虚拟化,等等 [ LXC内核命名空间 ],这里使用LXC的网络虚拟化来模拟多个网络环境. 创 ...