How to download and compile gvSIG 2.1.0 on Linux and Windows

English translation of the article by Joaquin del Cerro.

Note: I shall describe how to compile gvSIG Desktop core. This is only part of a broader process of distributing gvSIG. Other add-ons are compiled separately.

Hello all,

Typically, I develop on Linux, Ubuntu or Kubuntu. Download and compile gvSIG core for Ubuntu is often easy.

This can be done by executing a few simple commands which are easy to install because they are in the application packages repository and they can be installed using the “apt-get” command. You will need to have installed:

  • JDK 1.7, I often use “openjdk-7-jdk”
  • Subversion client, usually “subversion”
  • Maven, it is necessary to install “maven” package.

Execute it from command console

sudo apt-get install openjdk-7-jdk subversion maven

Once we have that, to download, compile and execute gvSIG proceed as follows:

~ $ cd
~ $ mkdir -p devel/gvsig-desktop
~ $ cd devel/gvsig-desktop
~ $ svn checkout https://devel.gvsig.org/svn/gvsig-desktop/trunk/org.gvsig.desktop/
...output for svn command...
~ $ cd org.gvsig.desktop
~ $ mvn install
... output for install command...
~ $ cd target/product
~ $ ./gvSIG.sh

Without having the tools to develop on Ms Windows, matters are slightly unstuck.

I’m going to tell you quickly what we should install to develop on MS Windows what we have already explained for Linux.

While is obviously necessary to have JDKSubversion and Maven JDK, as we have in Linux, I would also recommend a couple of utilities more.  What I miss most in Windows is a console with more capabilities. I would like most of all it would be resizable and I could configure the field history. After some research on the web, in the end I have opted for Console2. The project is hosted on SourceForge, and we can download the binary files from:

Next thing we will need is to have an environment for running Linux style shell files (bash). Among all of the environments available for MS Windows, I have chosen Busybox, because it combines compile and execute gvSIG into a single executable so system memory is not overflow. Download the binary files from:

This is just an executable, no additional installation is required. I have placed it in Windows folder, in my system only as a convenience.

C:\WINDOWS

Once we have downloaded both utilities, install Console2.Default values are generally appropriate. Only some modifications:

  • Increase Screen Buffer Size. Go to menu “Edit->Settings…” and we can change it in “Console” section. I usually have 2000.
  • Configure a new “tab”. In the same menu as before (Edit->Settings), go to “Tabs” section and configure a new tab with the following values:
  • Title “Terminal (busybox)”
  • Icon Use default
  • Shell “busybox bash -l”
  • Startup dir “C:\”

I leave it as the first “Tab” on the list and, in that way,   it is initiated by default when we start up Console2

Actually, if I start Console2  from the desktop icon I can already run “Linux” style shell scripts.

Now, install the following components:

  • JDK 1.7, available  for download at the Oracle website.

http://sourceforge.net/projects/win32svn/files/latest/download

I have installed it on the folder “C:/Program files”.

  • Maven, I downloaded it from a mirror on its official website:

http://apache.rediris.es/maven/maven-3/3.1.1/binaries/apache-maven-3.1.1-bin.zip

Once it has downloaded, I extracted it in the folder:

C:/Program files/apache-maven-3.0.5

Once everything is installed, it needs only same configurations. In the user HOME the “.profile” file must be created, in my case in:

C:/Documents and Settings/devel/.profile

A quick way to locate our HOME could be boot Console2  and in the shell we have just configured, run:

~ $ cd
~ $ pwd
C:/Documents and Settings/devel
~ $

And it will locate our HOME.

There we will create the “.profile” file with the following content:

#---------------------------
# .profile 
export JAVA_HOME="C:/Progam files/Java/jdk1.7.0_71"
PATH="$PATH;C:/Program files/Java/jdk1.7.0_71/bin"
PATH="$PATH;C:/Program files/Subversion/bin"
PATH="$PATH;C:/Program filse/apache-maven-3.0.5/bin"
alias l="ls -l "
alias ll="ls -l "
# 
#---------------------------

Basically, we create the JAVA_HOME variable and we add the folders with the JDKSubversion and Maven binary files to the PATH. Routes can changed depending on where you have installed the tools

Once created the file, we close the console and will reopen it to assure that console reads the file. We are ready to download, execute and compile gvSIG.

To do this, we run the same commands from our Console2 as I said before for Linux. Well, we will make a small change….download the fonts to “C:\devel”. This is to avoid problems with the length of file. Many windows programs, including “Explorer” or “cmd”, have problems to access files whose names are larger than 255 characters and at the end, there are usually quite   long file name in the gvSIG file structure.

~ $ cd c:/
~ $ mkdir devel
~ $ cd devel
~ $ svn checkout https://devel.gvsig.org/svn/gvsig-desktop/trunk/org.gvsig.desktop/
...output for svn command...
~ $ cd org.gvsig.desktop
~ $ mvn install
...output for install command...
~ $ cd target/product
~ $ ./gvSIG.sh

Just to make sure to reproduce this steps (links can change), I put on the link:

http://devel.gvsig.org/download/tools/gvsig-desktop/2.1.0

A copy of download files of:

In that way, everybody can have the same program version as me.

I had left out…

I hope comment it, albeit briefly, in next articles.

Regards,

Joaquín

This entry was posted in development, english, gvSIG Desktop. Bookmark the permalink.