首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何检测tomcat和ant是否安装在linux计算机上

问如何检测tomcat和ant是否安装在linux计算机上
EN

Stack Overflow用户
提问于 2013-02-21 06:30:03
回答 2查看 31.1K关注 0票数 3

我正在我的linux计算机上安装Tomcat和Ant,但是在安装它们之前,我只需要检查它们是否已经安装了。

关于tomcat

我在我的机器上搜索了很多,并在下面的目录中搜索tomcat

代码语言:javascript
复制
/usr/local/, /opt/, /usr/share/

但是我没有在上面的任何路径中找到tomcat文件夹,它是否表明没有安装tomcat?所以实际上

代码语言:javascript
复制
1. what is the path to `look/find` exactly to know/check whether tomcat is installed or not in 
   all linux machines
2. what will be the path the tomcat will be installed exactly after installation
3. How to find the version of tomcat on any linux machine (if tomcat already installed) 
4. Whether there are any commands to look for both whether `tomcat` installed and `ant` 
   installed

关于Ant

我搜索并得到了下面的命令,执行后得到了下面的结果

代码语言:javascript
复制
sh-4.2$ ant -v

结果

代码语言:javascript
复制
sh-4.2$ ant -v
Apache Ant(TM) version 1.8.2 compiled on November 21 2011
Trying the default build file: build.xml
Buildfile: build.xml does not exist!
Build failed

所以实际上

代码语言:javascript
复制
1. Does the above result mean that `Ant` is installed ? or not ?
2. what is the path to `look/find` exactly to know/check whether ant is installed or not in 
   all linux machines
3. what will be the path the `ant` will be installed exactly after installation
4. How to find the version of `Ant` on any linux machine (if Ant already installed) 
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-02-21 06:48:57

通常,您可以检查它们是否在$PATH上,如果它们不在$PATH上,则安装一个。

蚂蚁:

ant -v代表详细,ant -version打印它的版本。

代码语言:javascript
复制
   -help, -h
          print help on the command line options

   -projecthelp, -p
          gives information on possible targets for this project

   -version
          prints the version number and then exits ant

   -quiet, -q
          be extra quiet

   -verbose, -v
          be extra verbose

   -debug, -d
          print debugging information

   -emacs, -e
          produce logging information without adornments

   -logfile <file>, -l <file>
          use the given file to output log to

   -logger <classname>
          the class which is to perform logging

   -listener <classname>
          add an instance of the given class as a project listener

   -noinput
          do not allow interactive input

   -buildfile <file>, -file <file>, -f <file>
          use  the  given buildfile instead of the default build.xml file.
          This is the ant equivalent of Makefile

   -D<property>=<value>
          use value for the given property

   -keep-going, -k
          execute all targets that do not depend on failed target(s)

   -propertyfile <file>
          load all properties from file with -D properties  taking  prece-
          dence

   -inputhandler <class>
          the class which will handle input requests

   -find <file>, -s <file>
          (s)earch  for  buildfile  towards the root of the filesystem and
          use it

   -nice number
          A niceness value for the main thread: 1 (lowest)  to  10  (high-
          est); 5 is the default

   -nouserlib
          Run ant without using the jar files from ${user.home}/.ant/lib

   -noclasspath
          Run ant without using CLASSPATH

   -autoproxy
          Java 1.5+ : use the OS proxies

   -main <class>
          override ant's normal entry point

对猫来说:

如果tomcat/bin位于$PATH变量上,version.sh将打印该版本。

票数 3
EN

Stack Overflow用户

发布于 2018-10-08 09:46:06

对于linux ubuntu 18.04:

代码语言:javascript
复制
Go to terminal and command:$ sudo systemctl status tomcat

此命令还显示是否正在运行tomcat (如果已经安装)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14995936

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档