GvSIG Installation

1. Introduction

This article shows how to configure a developer environment with Eclipse IDE 3.3 (Europe) via SVN with the gvSIG sources. To get a stable realease of gvSIG we can connect to a specific tag instead of connecting to the trunk. Then, it is still possible to change to the trunk version.



Figure 1: Main gvSIG repository






2. Workspace settings


- Create your workspace:


Create a new workspace with Eclipse and set the text encoding to ISO-8859-1.


Figure 2: Create a new workspace


Figure 3: Workspace text encoding settings





- Make sure you have the right Java Virtual Machine (JVM) installed.


In order for the workspace to work propefly with gvSIG, jre files are not enough, you will need a Java Development Kit (JDK). Therefore, SUN Java 1.5 SDK (upgrade 12 or higher) is required, and make sure that both  Java JAI y Java JAI I/O are set at the classpath. If you do not know how to do that, you can simply download the latest version of gvSIG software and run the setup so that the installer does it for you (but again, a jre will be installed and not a jdk, so you will have to install it afterwards).

You can check if you see the jai_codec, jai_core.jar and jai_imageio. jar in your Preferences > Java > Installed JREs, by double-clicking at the our default java jdk version. You should see something like this:


 Figure 4: Selecting a Java Virtual Machine with JAI and JAI I/O


If these files are not added, you should look at somewhere like C:\Program Files\Sun Microsystems\Java Advanced Imaging 1.1.3\lib and add the via the "Add External JARs" button of the panel above, since this is where it is generally installed by default, or simply search for these jars in Windows and get its path.



- Don't build automatically:

Since it is highly probable that the project you will download will contain compilation errors at the very beginning, it is better to deactivate this option to do the build manually.



 Figure 5: Deactivate build automatically by uncliciking this option.





- Connect via SVN:

In order to connect to the gvSIG's SVN repository, you can use any SVN plugin for Eclipse. We will use Subclipse for this example, since this is the general option chosen by gvSIG developers.   You can use the SVN Repository Exploring option and add a new repository with the following gvSIG's URL:

http://subversion.gvsig.org/gvSIG


  Figure 6: Adding a SVN repository







3. Downloading a basic gvSIG workspace


We will start with downloading very simple workspace. For that, you must first connect to http://subversion.gvsig.org and select one of the builds of the 1.9 tag version. In our case, we have selected the build 1235. In the examples we will use version 1.9 of this build and version 2.0 since the proceeding is the same, but you should try it with build 1.9. The resulting tree structure is the following:



Figure 7: Tree structure of build 1235 repository



We will start with the 6 basic projects in order to run gvSIG:



  • At applications:
    • appgvSIG:        This application is one layer above _fwAndami in order to add geographic functionalities.
  • At binaries:
    • You will have to download this repository entirely, and not its children.

        It contains some JNI bindings and other native libraries of each operating system that some components need.

  • At libraries:
    • libCorePlugin:  This skin for _fwAndami implements the look and feel of the user interface.
    • libFMap:           This is the main library of gvSIG, which does all the main procesess such as geodata manipulation, painting, and so on.
    • libException:    This library provides the basics for the exceptions handling in gvSIG.
  • At extensions:

      There are numerous extensions that we could use, but we will leave them aside by now.

  • At frameworks:
    • _fwAndami:       Framework used by gvSIG as the MDI user interface.

Now you will obtain something like this:


Figure 8: Basic gvSIG workspace





- Things to do after download:


  • Remember to have the "Build Automatically" property off. If everything is fine, you should not see any red cross over your svn projects and you will be able to start running your first build.
  • For building all projects at once, it is very useful to use the install-all{},option of the build.xml Ant file at the appgvSIG folder. This file executes all the Ant files of the different libraries and extensions in the right order and sets all the jar files into _fwAndami folder, more precisely at _fwAndami/gvSIG/extensiones.


Note that if you get an error when running your workspace that says something like "you have two different versions of the same library", this is mainly because some of your projects copy different versions of the same jar file containing the same classes on that folder, so it crashes. Therefore, you will have to look for them at _fwAndami/gvSIG/extensiones to decide which version should be used and which one erased, and look at the corresponding Ant file that creates this jar erased, so that it is never generated again every time you launch your application.

  • Sometimes eclipse "gets dizzy" and "forgets" some library references (right click on the project, then "Build Path" > "Configure Build Path" and go to the Libraries or Projects tabs to solve any possible conflict). Try to find out where that real jar file is currently located, and then remove that wrong jar reference and add the right one.

4. Preparing your launch configuration


  - Main tab

By simply double clicking at the left option of "Java Application" you will get a new Launch item to be filled out at the right side of the panel.





  - Arguments tab

  • Program Arguments: You have to insert gvSIG gvSIG/extensiones, a folder located at fwAndami. This is where all the .class files will end up, once your workspace is built via the _install-all Ant file.
  • VM Arguments:          This argument differs from mac and from windows, you have to specicy the right within your downloaded binaries repository that corresponds to your operating system.
    • For Mac:               -Xmx500M -Djava.library.path=${workspace_loc}/binaries/mac
    • For Windows:       -Xmx500M -Djava.library.path=${workspace_loc}/binaries/w32

  - Environment tab

This variables are sometimes used whithin the project. Therefore, it is better to define them here. Again, PROJECT_LIB variable specifies where all the .class files will end up after building, whereas PATH variable specifies where the binaries are located.

  • PATH
    • For Mac:             ${workspace_loc}/binaries/mac
    • For Windows:       ${workspace_loc}/binaries/w32
  • PROJ_LIB

                  ${workspace_loc}/_fwandami/gvSIG/extensiones/org.gvsig.crs/data







Before launching it is always important to select all folders and right click to the "refresh" option, so that all new folders created are displayed. Then, execute the launcher created. If everithing goes fine, you will see something like this:


  - Possible compilation error

If you get an error like this, or a "minor_minor version error" when executing the launch icon, you will have to make sure that both the JRE and the compiler settings are set up with the same Java version. Java versions must be JDK or J2SE, not JRE.


Figure 9: JDK red cross compilance error.

This problem is easy to solve. Go to eclipse preferences panel and specify your compilance and java library correctly.

  • For Java 1.5
    • At Preferences > Java > Compiler, set JDK Compiler Compliance Level to 1.5.
    • At Preferences > Java > Installed JREs, set the JDK1.5 to the default one.
  • For Java 1.6
    • At Preferences > Java > Compiler, set JDK Compiler Compliance Level to 1.6.
    • At Preferences > Java > Installed JREs, set the JDK1.6 to the default one.


4. Building a bigger gvSIG project

In order to install the WSS extension, it is necessary extSymbology, among other projects, so be patient while you download the rest of the projects needed, which are:

  • At applications:
    • appCatalogAndGazetteerClient
  • At extensions:
    • extAddEventTheme
    • extCAD
    • extCatalogAndGazetteer
    • extGPE-gvSIG
    • extJCRS
    • extJDBC
    • extRasterTools-SE
    • extScripting
    • extSymbology
    • extWMS
  • At libraries:
    • gt2-epsg-hsql
    • jmrsid-src-0.0.0
    • libDriverManager
    • libGPE
    • libGPE-GML
    • libGPE-KML
    • libGPE-OSG
    • libGPE-OSG-examples
    • libGPE-XML
    • libInternationalization
    • libIverUtiles
    • libJCRS
    • libjni-ecw
    • libjni-ecwcompress
    • libjni-gdal
    • libjni-proj4
    • libRaster
    • libRemoteServices
    • libUIComponent

Once downloaded, note that you will get numerous compilation errors. Try to solve them in the following fashion:
#install-all feature (mentioned before)
#select all folders, right-click and "refresh"
#menu option Projects > Clean for cleaning all current projects.

At the end, you should get something like this:

Now, you just need to start Downloading the WSS extension.

Labels

 
(None)