在windows下安装opengrok遇到的一个问题

来源:互联网 发布:淘宝装修950模板 编辑:程序博客网 时间:2024/05/22 14:17

 

在做大型项目时,代码量非常大,一般不可能(时间也不够)充分的熟悉各个代码或资源文件,这时快速的定位代码或者文件的位置对于处理BUG就显得异常重要。想必你也用过windows自带的搜索,在文件非常多的时间,那个搜索的速度是无法容忍的。这里给大家推荐一个工具:opengrok。我主要用它来做一些搜索用,速度非常快,而且只要一个人在电脑上装好,同小组的其他人都可以通过浏览器访问,能更高效地提高整体的效率。至于它的细节,大家可以看看这篇在windows安装opengrok的文章:http://lifeisbetter.in/blog/2009/05/11/install-opengrok-on-windows/。

 

这里我主要说一个在安装过程中可能会遇到的问题,有些时间照着上面的步骤来安装,OpenGrok可以从浏览器上面访问到OpenGrok的页面了,但是在执行生成索引的命令时,仍然会报错:

 

Feb 14, 2011 6:06:31 PM org.opensolaris.opengrok.configuration.RuntimeEnvironmen

t validateExuberantCtags

SEVERE: Error: No Exuberant Ctags found in PATH!

(tried running ctags)

Please use option -c to specify path to a good Exuberant Ctags program

Feb 14, 2011 6:06:31 PM org.opensolaris.opengrok.index.Indexer main

SEVERE: Exception running indexer

......

 

可能你会觉得,已经把ctags路径加到环境变量里了,怎么还会报这个错呢。其实这是由不同的ctags版本引起的问题,你的系统多半是装有其他版本的ctags。运行ctags --version 可以查看版本号,我的系统由于装过Cygwin,所以已经有ctags了,而且这个ctags版本相对要旧些,所以有些功能可能没加上,运行时就报错了。

 

Cygwin中的版本:

C:/Documents and Settings/prince58>ctags --version

ctags (GNU Emacs 21.4.17)

Copyright (C) 1999 Free Software Foundation, Inc. and Ken Arnold

This program is distributed under the same terms as Emacs

 

Ctags 5.8的版本:

C:/Documents and Settings/prince58>ctags --version

Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert

  Compiled: Jul  9 2009, 17:05:35

  Addresses: <dhiebert@users.sourceforge.net>, http://ctags.sourceforge.net

  Optional compiled features: +win32, +regex, +internal-sort

 

 

解决方法:

 

暂时把Cygwin/bin/下面的ctags删除(剪切到非环境变量的目录),然后再运行。完成后恢复即可。