Ubuntu16.04搭建OpenGrok环境

搭建的目标平台系统版本: Ubuntu 16.04.2 LTS  .

本方法对其它ubuntu版本同样适用。

准备以下Tools:

  1.         apache-tomcat-9.0.8(https://tomcat.apache.org/download-90.cgi
  2.         java-8-openjdk-amd64
  3.         opengrok-1.1-rc36(https://github.com/oracle/opengrok/releases

                 PS:rc35后脚本开始从shell切换到python, 我用的:https://github.com/OpenGrok/OpenGrok/releases/download/1.1-rc3/opengrok-1.1-rc3.tar.gz

   4.    ctags(https://github.com/universal-ctags/ctags

写在前面: 听说用python脚本搭建简便快捷,我搭建前期也是用Python脚本的方法摸索了一些时间,脚本执行出一些语法错误。果断放弃。转而摸索手动搭建。所以本文对不会python的朋友更加适用。 会python大拿可以查阅用python脚本搭建opengrok的方法(可参阅https://blog.csdn.net/lookfuyao/article/details/84991756?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.channel_param&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.channel_param)。

1. 安装Java

  我的电脑之前已经安装。安装过程此处略过。 没有安装可以参考一下链接的安装部分:

https://blog.csdn.net/yzx_zjut/article/details/81951869  :

1)通过 sudo yum install java 或者 sudo apt-get install java安装java 1.8.x版本(已有java1.8版本可跳过该步骤)
2)查看设备Java版本号,确保$ java -version 为 java version “1.8.x”及以上版本
3)在 .bash_prifile中配置JAVA_HOME为安装目录

########--java environment setting--#######
 export JAVA_HOME="/opt/yaozhongxiao/java" 

2.安装ctags

 获取universal ctags软件: git clone https://github.com/universal-ctags/ctags.git 

查看安装指导(https://gitee.com/neo532/universal-ctags (How to build and install)):

To build with Autotools, see docs/autotools.rst for more information. (To build on GNU/Linux, Autotools is your choice.) To build on Windows, see docs/windows.rst for more information. To build on OSX, see docs/osx.rst for more information.

根据上述 docs/autotools.rst 指导执行:

 ator@ator-hp-prodesk-680-g4-mt:/opt/ctags-master$ sudo apt install \
        gcc make \
        pkg-config autoconf automake \
        python3-docutils \
        libseccomp-dev \
        libjansson-dev \
        libyaml-dev \
        libxml2-dev

ator@ator-hp-prodesk-680-g4-mt:/opt/ctags-master$ sudo  ./autogen.sh

 PS :执行此步骤一定sudo,不然会报如下错误:
+ type autoreconf
+ type pkg-config
+ [ -z  ]
......
+ autoreconf -vfi
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autom4te: cannot create autom4te.cache: No such file or directory
aclocal: error: echo failed with exit status: 1
autoreconf: aclocal failed with exit status: 1
+ echo failed in running autoreconf
failed in running autoreconf
+ exit 1

ator@ator-hp-prodesk-680-g4-mt:/opt/ctags-master$ sudo ./configure

ator@ator-hp-prodesk-680-g4-mt:/opt/ctags-master$ sudo make -j8

ator@ator-hp-prodesk-680-g4-mt:/opt/ctags-master$ sudo make install

ator@ator-hp-prodesk-680-g4-mt:/opt/ctags-master$ ctags --version
Universal Ctags 5.9.0, Copyright (C) 2015 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: Nov 17 2020, 19:30:57
  URL: https://ctags.io/
  Optional compiled features: +wildcards, +regex, +iconv, +option-directory, +xpath, +json, +interactive, +sandbox, +yaml, +packcc

3. 部署opengrok 到 Tomcat :

解压下载的opengrok和Tomcat包到任意路径下并解压 ,我的在/opt/路径。

部署/opt/opengrok-1.1-rc3/lib/source.war

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值