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

From Anupama of Greenstone Team
DateWed Dec 10 13:01:39 2008
Subject [greenstone-users] Re: [greenstone-devel] Re: trouble building greenstone3 from source
In-Reply-To (492B8158-1000907-cs-waikato-ac-nz)
Copied to the list.


Hello again Andrew,

The solution of another developer (Quan, qq6) that recently worked in a
Linux context may also be applicable in dealing with the javagdbm
compilation problem you encountered.

As per their suggestion, try compiling with Java 5 rather than Java 6 by
setting your JAVA_HOME to the former.

Yesterday, a developer here who was trying to compile Greenstone 3 from
SVN on their Windows laptop got the same compilation error, while it
succeeded for me when I tried it out immediately thereafter on another
Windows machine. I suspected my environment settings must have been
different. And now I see that they were: both my Windows and Linux
machines are set to use a JDK 5 for JAVA_HOME whereas the other
developer had set JAVA_HOME to 6 on their laptop.

Therefore, when you get a chance, will you try this out and inform us if
it didn't solve the problem for you?

Thanks,
Anupama


> Skip the previous email I just sent. Below is the same, but with some
> important corrections.
>
> 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 the arguments "compile" and "javaonly" to winMake.bat cause it to
> call another winMake.bat makefile located
> at Greenstone3/src/packages/javagdbm/java, passing it 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/java/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 ALL_UPPERCASE.
> 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
> 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 line
> set JAR="%JAVA_HOME%binjar"
> in your Greenstone3/src/packages/javagdbm/java/winMake.bat file,
>
> can you paste the following bits between >>>> <<<<:
> >>>>
> 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 of them is conspicuous. For instance:
> - Do all the printed paths have a value or is any left as ""?
> - And when you look for these folders 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.
> >
> >
>
> _______________________________________________
> greenstone-devel mailing list
> greenstone-devel@list.scms.waikato.ac.nz
> https://list.scms.waikato.ac.nz/mailman/listinfo/greenstone-devel
>