User Tools

Site Tools


en:user_advanced:installation_312

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:user_advanced:installation_312 [2025/07/15 08:56] – [Source Component] anupamaen:user_advanced:installation_312 [2025/07/16 01:04] (current) – [Check developer tools and set up environment] kjdon
Line 28: Line 28:
  
 Prerequisites for compiling the source component and source distribution on Windows: Prerequisites for compiling the source component and source distribution on Windows:
-  * **Java:** JDK 8 is the minimum version needed. For compiling on Windows 64 bit, you will need the 64 bit version of JDK.   + 
-      * If you have a JDK already installed, please set the JAVA_HOME variable in local/gs3-setup.bat +  * **Microsoft Visual Studio** (8 or later) - for C++ compiling. You can download a free version from [[https://visualstudio.microsoft.com/]] 
-      * If you don't have a JDK, please run get-selfcontained-jdk.bat in the ext-cli folder - this will download a JDK 11. +     (TODO - test whether buildtools is enough) 
-  * **Microsoft Visual Studio** (8 or later) - for C++ compiling. +    
-    * Please edit local/gs3-devel.bat and check that the paths to Visual Studio and the vcvars script are correct+
   * **Apache Ant:** Version??   * **Apache Ant:** Version??
     * If you don't already have Ant installed, please run get-selfcontained-ant.bat in the ext-cli folder     * If you don't already have Ant installed, please run get-selfcontained-ant.bat in the ext-cli folder
-  * PERLif you're using GS3.07 or earlier, get ActivePerl for Windows. From GS3.08 onwards, binaries and source distributions come with [[http://trac.greenstone.org/browser/main/trunk/release-kits/shared/windows/perl.zip|Strawberry Perl]] located in the GS3's ''gs2build\bin\windows\perl'' folder.+  * **Perl:** From 3.12 you need to use Greenstone provided Perl which comes with all the necessary cpan libraries installedThis is supplied in a binary release but not in the source distribution. 
 +    * Please run get-selfcontained-perl-with-cpan.bat in the ext-cli folder. 
 +    * (Alternatively you can download the perl tarball...)  
 +  * 
   * (If you want to compile GS3 with debugging on, you will need Microsoft SDK)    * (If you want to compile GS3 with debugging on, you will need Microsoft SDK) 
     * ?? add this to gs3-devel.bat??  ''call "C:\Program Files\Microsoft SDKs\Windows\v6.1\Bin\SetEnv.cmd"''     * ?? add this to gs3-devel.bat??  ''call "C:\Program Files\Microsoft SDKs\Windows\v6.1\Bin\SetEnv.cmd"''
  
 +Note: the bundled tar.exe (for unzipping) doesn't work on Windows 11. If you are having issues with this, please delete gs2build/bin/windows/tar.exe.
 +
 +  * **Java:** JDK 8 is the minimum version needed. JDK 8 or 11 are recommended. GS hasn't been tested yet on higher Java versions. For compiling on Windows 64 bit, you will need the 64 bit version of JDK.  
 +      * If you have a JDK already installed, please set the JAVA_HOME variable in local/gs3-setup.bat
 +      * If you don't have a JDK, please run get-selfcontained-jdk.bat in the ext-cli folder - this will download a JDK 11.
  
  
Line 46: Line 53:
   - Get the source component zip file from the downloads page.   - Get the source component zip file from the downloads page.
   - Unzip it directly into your Greenstone installation folder, make sure not to create intermediary folders. If Windows prompts you about whether you want existing folders merged (and existing files replaced), tick the box to confirm for all and click in the affirmative.   - Unzip it directly into your Greenstone installation folder, make sure not to create intermediary folders. If Windows prompts you about whether you want existing folders merged (and existing files replaced), tick the box to confirm for all and click in the affirmative.
 +
 +=== Check developer tools and set up environment ===
   - Open a DOS prompt to run the following scripts and commands:   - Open a DOS prompt to run the following scripts and commands:
-  - Go into your Greenstone installation folder, ''cd C:\path\to\greenstone3'', and run ''gs3-devel.bat''This will allow Greenstone to unzip zip filesIt will also provide an ANT installation in case you don't have onesince the GS3 binary comes with antIt runs your local scripts to set up the Visual Studio environment. +  - Go into your Greenstone installation folder, ''cd C:\path\to\greenstone3'' 
-  - The Java Runtime (JRE) included with Greenstone 3 binaries is a 32 bit Java 8 runtime. This means that //if the Windows machine that you're recompiling the binary with the source component on is not 32 bit Java too//, then you will need to do the following before compiling \\+  - ** Visual Studio**  - edit local/gs3-devel.bat and check that the paths for the Visual Studio commands are correct. 
 +  - ** Java **  - the binary release only comes with a JRE, compiling needs a JDK. Greenstone needs Java 8 or 11 (its untested on higher versions) 
 +      * If you have a suitable Java already installed, please edit local/gs3-setup.bat and set JAVA_HOME to the path of your Java installation
 +      * If you don't have a JDKplease run get-selfcontained-jdk.bat in the ext-cli folder - this will download a JDK 11. 
 +  - ** Ant ** - Ant is bundled in the binary release 
 +  - ** Perl ** - Perl is also bundled in the binary release. 
 +  - In the greenstone3 folder, run ''gs3-devel.bat'' - this will set up all the necessary environment variables needed for compiling 
 +    
 +  - The Java Runtime (JRE) included with Greenstone 3 binaries is a 32 bit Java 8 runtime. This means that //if the Windows machine that you're recompiling the binary with the source component on is not 32 bit Java too//, then you will need to do the following before compiling \\
      * rename ''packages\jre'' to something else, so that when Greenstone runs after compiling, it uses your system Java rather than the old 32 bit JRE v7.      * rename ''packages\jre'' to something else, so that when Greenstone runs after compiling, it uses your system Java rather than the old 32 bit JRE v7.
      * run ''ant distclean'' from the toplevel Greenstone installation folder, to clear all the older compile products created by compiling with 32 bit Java 7.\\ If you see the following error message <code>     [exec] Could Not Find GS3\gs2build\common-src\src\gdbmedit\gdbmdel\*.obj      * run ''ant distclean'' from the toplevel Greenstone installation folder, to clear all the older compile products created by compiling with 32 bit Java 7.\\ If you see the following error message <code>     [exec] Could Not Find GS3\gs2build\common-src\src\gdbmedit\gdbmdel\*.obj
Line 72: Line 89:
  
 BUILD FAILED BUILD FAILED
-GS3\build.xml:4104: exec returned: 2</code>Edit your GS3\gs2build\common-src\indexers\winMake.bat script by commenting out the following line in it<code>::if %VISUAL_STUDIO_MAJORVERSION% LSS 14 set ICONVZIP=iconv-PRE-VS14.zip</code>\\ If you see a failure message about being unable to delete a file called 'cp.jar', run ''del \path\to\cp.jar'' manually from the command line for the exact file path listed. Then re-run ''ant distclean''. There are several cp.jar files in different locations of the GS3 installation, any or all of which can cause this failure message. So keep repeating the cycle of re-running ''ant distclean'' then manually running ''del'' on any cp.jar file listed in any failure message, until the ''ant distclean'' step finally succeeds (so without failure messages). This issue may be due to Windows having filelocks on the ''cp.jar'' files. +GS3\build.xml:4104: exec returned: 2</code>Edit your GS3\gs2build\common-src\indexers\winMake.bat script by commenting out the following line in it<code>::if %VISUAL_STUDIO_MAJORVERSION% LSS 14 set ICONVZIP=iconv-PRE-VS14.zip</code>\\ If you see a failure message about being unable to delete a file called 'cp.jar', run the following from the greenstone3 folder: ''del cp.jar admin\cp.jar lib\java\cp.jar lib\jni\cp.jar web\lib\cp.jar''. Running ''ant clean-classpath-jars'' will tell you if there are any cp.jar left that are unable to be deleted. manually from the command line for the exact file path listed. Then re-run ''ant distclean''. There are several cp.jar files in different locations of the GS3 installation, any or all of which can cause this failure message. So keep repeating the cycle of re-running ''ant distclean'' then manually running ''del'' on any cp.jar file listed in any failure message, until the ''ant distclean'' step finally succeeds (so without failure messages). This issue may be due to Windows having filelocks on the ''cp.jar'' files. 
-     * you may also want to want to delete ''gli\jar'' and ''gli\classes\org'', **if they exist**, to clear up GLI before recompiling.     +         
   - Finally, you can compile Greenstone 3. Still in your Greenstone installation folder, run ''ant install''.   - Finally, you can compile Greenstone 3. Still in your Greenstone installation folder, run ''ant install''.
 +  - Grab the strawberry perl-with-cpan for Windows from https://trac.greenstone.org/browser/gs2-extensions/perl-with-cpan/trunk/strawberry-perl-5.32.1.1-MSWin32-x86-multi-thread.zip\\ and unzip it into ''gs2build/bin/windows''. Rename the unzipped folder to ''strawberry-perl'', and make sure it doesn't contain a subfolder starting ''strawberry-perl'' (if it does, the strawberry-perl subfolder should be the one directly under ''gs2build/bin/windows'').
  
 **To run GS3 after re-compiling:** **To run GS3 after re-compiling:**
Line 140: Line 158:
   * [[en:developer:install_svn|SVN]]   * [[en:developer:install_svn|SVN]]
   * ANT   * ANT
-  * Java JDK. JDK 7 for Greenstone 3.06 and onwards. \\ **WARNING:** But **do not use Oracle's JDK version 1.8.0_//161//** as it is problematic: failing to compile GS3 and also failing to successfully run the [[http://wiki.greenstone.org/doku.php?id=en:release:3.09_release_notes&s[]=191#troubleshooting|solr web servlet]] in GS3 binaries. We found that Oracle's JDK versions 1.8.0_144 and **1.8.0_//191// worked** for us.+  * Java JDK. JDK 8 is the minimum version required \\ **WARNING:** But **do not use Oracle's JDK version 1.8.0_//161//** as it is problematic: failing to compile GS3 and also failing to successfully run the [[http://wiki.greenstone.org/doku.php?id=en:release:3.09_release_notes&s[]=191#troubleshooting|solr web servlet]] in GS3 binaries. We found that Oracle's JDK versions 1.8.0_144 and **1.8.0_//191// worked** for us.
   * C/C++ compiler: XCode on Mac, gcc/g++ on Linux   * C/C++ compiler: XCode on Mac, gcc/g++ on Linux
  
en/user_advanced/installation_312.1752569784.txt.gz · Last modified: 2025/07/15 08:56 by anupama