Friday, July 20, 2012

Installing OpenGrok on Windows

Installing OpenGrok on Windows

Steps for installing OpenGrok.

  1. Download the OpenGrok binary from OpenGrok Binary.
  2. Unzip the tar to a location say "G:\OpenGrok"
  3. Download Ctags from Ctags Windows Binary.
  4. Extract Ctags to a location say "G:\Ctags"
  5. Download and install Tomcat.
  6. OpenGrok needs the following to run
    1. A configuration.xml that is generated using the command in step 8.
    2. Location to the source being indexed. (SRC_ROOT)
    3. Location to the "Ctag" generated grokData, again refer to step 8.  (DATA_ROOT)
  7. Extract the "war" file in the "lib" folder in the extracted OpenGrok location. In this case  G:\opengrok-0.11.1\lib.
  8. Edit the WEB-INF\web.xml file to include the information discussed above (step 6)
  9.  <context-param>  
       <description>Full path to the configuration file where OpenGrok can read it's configuration</description>  
      -------Added the below------  
  10. Copy the the extracted source.war with the modified web.xml to the tomcat webapps folder. 
  11. Index the source and generate the configuration.xml file using the below command (G:\opengrok-0.11.1\lib has the jar file)
  12.  java -jar opengrok.jar -W G:\opengrok-0.11.1\configuration.xml -c G:\ctags58\ctags.exe -P -S -v -s G:\CodeSource -d G:\opengrok-0.11.1\grokdata  
  13. Launch Tomcat after the indexing in done. Open http://localhost:8080/source and wola you have a wicked fast source browser. 
  14. Reindex if you need to add new projects/pick new source etc.


  1. Very nice, good job.
    It is worth noting that source.war must be unpacked under G:\opengrok-0.11.1\lib\source, not G:\opengrok-0.11.1\lib
    Also .war files are archives that can be unpacked by WinZIP or WinRAR.

  2. Good instructions!

    If you want to use CxxAnalyzer to process .h files, you will have to add -A argument to override the default behavior.

    -A h:org.opensolaris.opengrok.analysis.c.CxxAnalyzerFactory

  3. Great instructions - it worked for me!

  4. Thanks for the instructions. I had minor issues (filenotfoundexception for configuration.xml)and the following worked for me.

    I was using tomcat7.

    The source.war needed to goto
    C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\source

    Also the web.xml you mean is under
    C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\source\WEB-INF

    Only thing I had to change was

  5. great instructions, thanks so much

  6. that's a great instruction... I would like to add something just in case there might people like me not that much expert with in and out of Tomcat installation...
    for running the tomcat (tomcat 7.0 I use), try the startup script from the cmd. This way, it would build up the source folder in the webapps.




    are not necessary

  8. This comment has been removed by the author.

  9. This comment has been removed by the author.

  10. Hi ,

    How do i configure svn url directly instead of checking out source to "SRC_ROOT" folder. Is there a way that opengrok update indexes when ever there is a check-in ?

  11. as i found "-r on" to enable remote SCM systems..

    1. Hi Rahul,

      Can you please provide details steps, where do i need to "-r" in configuration.xml. If you have detail steps for configuring, please lets us know steps.

  12. Do you have similar steps for setting it up in a linux machine running Ubuntu, please?

    this blog has wrong section 7 and 8, fix in above link

  14. The link provided for the binary is broken.
    I tried the step by step instruction provided on youtube, and I was successful in setting up openGrok

    1. i tried the link in the mv, but the link is borken too. but i find the binary is "". you can find it in google.

  15. Can anyone help to configure the source to be indexed as gitlab.