java 由于缺少 catalina.bat,NetBeans 8.0.2 无法启动 Tomcat
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30146939/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
NetBeans 8.0.2 fails to start Tomcat because of missing catalina.bat
提问by Wade Guest
I just finished setting up the prelimanary steps for a Java Web project on NetBeans. I installed NetBeans and created a network drive using Samba on my home Ubuntu Server, which has Tomcat7. When I try to run the example Hello World project, i get the following error:
我刚刚完成了在 NetBeans 上为 Java Web 项目设置的预备步骤。我安装了 NetBeans 并在我的家庭 Ubuntu 服务器上使用 Samba 创建了一个网络驱动器,它有 Tomcat7。当我尝试运行示例 Hello World 项目时,出现以下错误:
Starting of Tomcat failed, the Z:\usr\share\tomcat7\bin\catalina.bat startup script is missing. C:\Users\\Documents\NetBeansProjects\WebApplication1\nbproject\build-impl.xml:1150: Starting of Tomcat failed, the Z:\usr\share\tomcat7\bin\catalina.bat startup script is missing. BUILD FAILED (total time: 3 seconds)
Tomcat启动失败,Z:\usr\share\tomcat7\bin\catalina.bat启动脚本丢失。C:\Users\\Documents\NetBeansProjects\WebApplication1\nbproject\build-impl.xml:1150:Tomcat启动失败,Z:\usr\share\tomcat7\bin\catalina.bat启动脚本丢失。构建失败(总时间:3 秒)
I checked the directory its is referencing and there is a catalina.sh file but no .bat file. Anyone know hints to get this file or how to get NetBeans to run the .sh file instead?
我检查了它所引用的目录,有一个 catalina.sh 文件但没有 .bat 文件。任何人都知道获取此文件的提示或如何让 NetBeans 改为运行 .sh 文件?
回答by Amila
If you are using Windows, Netbeans need the .bat
file, not the .sh
file.
如果您使用的是 Windows,则 Netbeans 需要.bat
文件,而不是.sh
文件。
catalina.bat
file is distributed with the Tomcat binary distribution.
catalina.bat
文件随 Tomcat 二进制分发版一起分发。
It's not in your path means either you have mingled with the files or you have downloaded wrong distribution (eg: source distribution).
它不在您的路径中意味着您已与文件混合或下载了错误的发行版(例如:源发行版)。
So download a fresh copy of tomcat from here, set the path correctly and try again.
所以从这里下载一个新的 tomcat 副本,正确设置路径并重试。
回答by alejandro
Download the appropiate zip file from https://tomcat.apache.org/. I use Tomcat 8.0.33 and I download zip file from the zip link in the Binary Distributions subsection of the 8.0.3 section download zip file.
Open the zip file (you don't need uncompress it), go to bin folder, copy the catalina.bat file.
Go to Apache Tomcat bin folder in you machine and paste the catalina.bat file.
Go to you NetBeans, click on Services tag (window -> services), left click in ApacheTomcat, click Start option
If must copy other files like setclasspath.bat, go to step 2.
从https://tomcat.apache.org/下载合适的 zip 文件。我使用 Tomcat 8.0.33,并从 8.0.3 部分下载 zip 文件的二进制分发小节中的 zip 链接下载 zip 文件。
打开zip文件(不需要解压),进入bin文件夹,复制catalina.bat文件。
转到您机器中的 Apache Tomcat bin 文件夹并粘贴 catalina.bat 文件。
转到您的 NetBeans,单击服务标签(窗口 -> 服务),在 ApacheTomcat 中左键单击,单击开始选项
如果必须复制其他文件,如 setclasspath.bat,请转到步骤 2。
回答by Stelios Adamantidis
For some reason that I don't know, if you download the zipversion of Tomcat, the .bat
s are there. It's not the same for the installerversion though. (I am on Windows BTW, I don't know what happens on Linux.)
出于某种我不知道的原因,如果您下载Tomcat的zip版本,那么.bat
s 就在那里。但是安装程序版本不一样。(我在 Windows 上 BTW,我不知道在 Linux 上会发生什么。)
回答by Dapper Dan
The Problem is happening when you are using the installer, use the distribution copy. it worked for me
使用安装程序时出现问题,请使用分发副本。它对我有用