[greenstone-users] Re: trouble building greenstone3 from source

From ak19@cs.waikato.ac.nz
DateTue Nov 25 23:26:00 2008
Subject [greenstone-users] Re: trouble building greenstone3 from source
In-Reply-To (492B29B2-2010103-cs-waikato-ac-nz)
Hello Andrew,

I tried compiling up a fresh checkout of Greenstone 3 from SVN on the
Windows machine here and did not encounter this problem. However, this may
be because my settings for Java are set up in such a manner that it worked
out.

- Do you have a JDK installed on your machine?
- What is your JAVA_HOME set to?
- Do you have the following files in your JAVA_HOMEbin folder:
javac
javah
java
javadoc
jar

I do not know to what extent you are familiar with programming, but seeing
as how you are compiling up GS3 from SVN, I thought I could explain the
following to you so that you can try out a few things to narrow down where
the problem might be.

Concerning this bit that you referred to:
>> compile-packages:
>> [echo] compile javagdbm
>> [echo] Windows: compile javagdbm (java only)
>> [exec] Compiling...
>> [exec] The system cannot find the path specified.
>> [exec] The system cannot find the path specified.
>> [exec] The system cannot find the path specified.
>> [echo] Install the javagdbm jar file

These print statements happen in your Greenstone3/build.xml file (around
line 1200).

At the stage this happens, the build.xml is calling the makefile
"winMake.bat" located in your Greenstone3/src/packages/javagdbm folder and
passing the arguments "compile" and "javaonly".

During execution of this makefile, some directory path is referred to that
it cannot find, causing the compilation to fail at this stage which then
causes the build to fail when the javagdbm jar file has not been produced.

1. In a DOS prompt, can you go to the directory
Greenstone3/src/packages/javagdbm/ and then from there type:
winMake.bat compile javaonly
Does it give some error statements here?

2. If so, can you go one directory further down into a folder called java
(so that now you are in Greenstone3/src/packages/javagdbm/java) and type:
winMake.bat compile
Are there any error statements appearing here now?

If there was no error output in doing either 1. or 2. above, neither 3 nor
4 below are necessary:
3. If you open up the file Greenstone3/src/packages/javagdbm/winMake.bat
in Wordpad (Notepad doesn't preserve the lines very well), you will see
that these arguments cause it to call another winMake.bat makefile located
at Greenstone3/src/packages/javagdbm/java, with the "compile" argument.

The first question is, do you have a folder called java situated inside your
Greenstone3/src/packages/javagdbm/? And does
Greenstone3/src/packages/javagdbm/java contain a file called winMake.bat?

4. If so:
When opening up the Greenstone3/src/packages/javagdbm/winMake.bat file in
WordPad, you may perhaps notice that it refers to lots of directory paths.
It stores many of these paths in variables marked by ALLUPPERCASE.
Sometimes it may happen that in reality these paths contain spaces like
"Program Files". This could cause problems if spaces are indeed involved,
unless such paths are embedded in quotes.

Can you replace the following section in your the
Greenstone3/src/packages/javagdbm/java/winMake.bat file with the bit that
follows it:
>>>>REPLACE FOLLOWING:
:compile
if not exist %JAVACLASSDIR% mkdir %JAVACLASSDIR%
echo Compiling...
%JAVAC% -d %JAVACLASSDIR% %JAVACOPTIONS%
aucompharosgdbm*.java aucompharosio*.java
aucompharosmeta*.java aucompharospacking*.java
aucompharos est*.java aucompharosutil*.java
%JAVAH% -classpath %JAVACLASSDIR% -o %JAVAGDBMHOME%jniGdbmFile.h
au.com.pharos.gdbm.GdbmFile
%JAR% cf %JAVAGDBMHOME%javagdbm.jar -C %JAVACLASSDIR% au
goto done
<<<<

>>>>REPLACE WITH:
:compile
if not exist "%JAVACLASSDIR%" mkdir "%JAVACLASSDIR%"
echo Compiling...
"%JAVAC%" -d "%JAVACLASSDIR%" "%JAVACOPTIONS%"
aucompharosgdbm*.java aucompharosio*.java
aucompharosmeta*.java aucompharospacking*.java
aucompharos est*.java aucompharosutil*.java
"%JAVAH%" -classpath "%JAVACLASSDIR%" -o
"%JAVAGDBMHOME%jniGdbmFile.h" au.com.pharos.gdbm.GdbmFile
"%JAR%" cf "%JAVAGDBMHOME%javagdbm.jar" -C "%JAVACLASSDIR%" au
goto done
<<<<

Now, back in your DOS prompt, from within the
Greenstone3/src/packages/javagdbm/ directory, type:
winMake.bat compile javaonly

Do you still see the same problems?

5. If the above changes did not fix the errors, we can print out the
values of these paths to make sure they are all set to something that
makes sense.

After the following line in your
Greenstone3/src/packages/javagdbm/java/winMake.bat file:
set JAR="%JAVA_HOME%binjar"

Can you paste the following:
echo javagdbmhome: "%JAVAGDBMHOME%"
echo javaclassdir: "%JAVACLASSDIR%"
echo.
echo javac: "%JAVAC%"
echo javah: "%JAVAH%"
echo java: "%JAVA%"
echo javadoc: "%JAVADOC%"
echo jar: "%JAR%"

Go back to your DOS prompt and from within
Greenstone3/src/packages/javagdbm/java/ type:
winMake.bat compile

Hopefully it should now print out all the values of the paths above so
that you can see whether any is conspicuous.
- Do they all have a value or is any left as ""?
- And when you look for them in Windows Explorer, are you able to find all
the folder paths which were just printed out to the DOS prompt?

Tell us how you get on,
Anupama


> Andrew Marlow wrote:
>> hello,
>>
>> I am trying to build greenstone3 from source and I have hit a problem.
>>
>> I downloaded it using the instructions for SVNon the greenstone3 web
>> page, then I said ant prepare install. Below is the end of the build
>> log, which shows the error message:
>>
>> ---
>> configure-gs2building:
>>
>> configure-c++:
>>
>> compile-web:
>> [javac] Compiling 1 source file to
>> c:everythingamarlowdevelopmentmystuff
>> researchdigital_librariesgreenstone3webWEB-INFclasses
>>
>> compile-packages:
>> [echo] compile javagdbm
>> [echo] Windows: compile javagdbm (java only)
>> [exec] Compiling...
>> [exec] The system cannot find the path specified.
>> [exec] The system cannot find the path specified.
>> [exec] The system cannot find the path specified.
>> [echo] Install the javagdbm jar file
>>
>> BUILD FAILED
>> c:everythingamarlowdevelopmentmystuffresearchdigital_librariesgreenstone3
>> build.xml:1211: Warning: Could not find file
>> c:everythingamarlowdevelopment
>> mystuffresearchdigital_librariesgreenstone3srcpackagesjavagdbmjavagdbm.ja
>> r to copy.
>>
>> Total time: 25 minutes 32 seconds
>> ----
>>
>> What am I doing wrong please?
>>
>
> I'll get one of the research programmers to double check the SVN
> checkout and compile sequence under Windows, but in the meantime, what
> version of Windows, Java and Visual Studio are you using? Can you also
> check and let us know what the JAVA_HOME environment variable is set to
> for you set up.
>
> Thanks,
>
> David.
>
>> --
>> Regards,
>>
>> Andrew M.
>
>