wiki:SetUpCommandLine
Last modified 3 weeks ago Last modified on 05/07/12 15:32:19

Compiling GeoGebra from command line

This guide is mainly for users of Unix-like operating systems. GeoGebra can be compiled without installing Eclipse, and here we provide the needed steps on a typical Linux installation. If you are interested in internals of the building process, see BuildingProcess.

We assume that Debian Linux 5.0, 6.0 or a recent Ubuntu Linux is used for the underlying operating system.

Prerequisities

You need the following additional software after installing the base Debian system:

  1. Subversion. (If you are behind a proxy, you may need to edit the ~/.subversion/servers file and set the http-proxy-host and http-proxy-port variables in the [global] section of the configuration file.)
  2. A suitable Java. We used to use Sun/Oracle Java, but since OpenJDK also works properly, you are encouraged to use it instead of Sun/Oracle Java.
  3. Ant (version 1.8.0 or newer is suggested).

On a recent Debian/Ubuntu Linux you can install these software by running apt-get install subversion java-6-openjdk ant.

Downloading the source from the GeoGebra SVN server

  1. Create a working directory. Its name can be anything you choose, but for now we will use svn. So enter cd; mkdir svn; cd svn as a normal user (non-root, however, root will also work).
  2. Download the sources for the first time: enter svn co --force http://dev.geogebra.org/svn/trunk/geogebra. If you get an error message (e.g. svn: OPTIONS of 'http://dev.geogebra.org/svn/trunk/geogebra': could not connect to server (http://dev.geogebra.org)) you may have to edit your proxy settings (see above).

Now a subdirectory has been created, its name is geogebra. Enter into it: cd geogebra.

Compilation

Never try to mix command line and Eclipse builds on the same working copy. The command line build may create directories which will confuse Eclipse and the Eclipse build will no longer work.

  1. Enter the desktop directory: cd desktop.
  2. Download the required 3rd party libraries by entering ant -f kickstart.xml geogebra4-developer-commandline in the root directory of the repository.
  3. Enter the following command: scripts/autobuild/make-vanilla-jars and follow the instructions. (You have to select a Java home directory by using the -j option.)

You may expect errors on compilation, e.g.

4726 problems (260 errors, 4466 warnings), see .ecjlog for more details

This is because the GeoGebra 5 related files will also be compiled, and the related 3rd party libraries are not downloaded by default. You may safely ignore these errors, or you may enter ant -f kickstart.xml geogebra4-developer-commandline above to get rid off the errors.

Running GeoGebra

  1. Go to the build directory by typing cd build.
  2. Run GeoGebra by entering java -jar geogebra.jar.

More details on the building process

See BuildingProcess and Deploy for more details.

Troubleshooting

Problems installing Sun Java 1.5 on Ubuntu/Debian Linux

Try this: Edit /etc/apt/sources.list:

deb http://hu.archive.ubuntu.com/ubuntu/ jaunty multiverse
deb-src http://hu.archive.ubuntu.com/ubuntu/ jaunty multiverse
deb http://hu.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse
deb-src http://hu.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse

Now enter apt-get update; apt-get install sun-java5-jdk as root.

Running GeoGebra by using OpenJDK

If you find missing libraries:

Exception in thread "main" java.lang.UnsatisfiedLinkError:
Can't load library: /usr/lib/jvm/java-6-openjdk/jre/lib/i386/xawt/libmawt.so

then you should simply install the missing libraries. See http://ubuntuforums.org/showthread.php?t=1099777 for such an example in Ubuntu.

Running GeoGebra Webstart by using OpenJDK (inside a web browser)

Currently it doesn't seem to work: you have to install Sun Java plugin (e.g. sun-java6-plugin on Ubuntu). See #1570 as well.

Error 'delete doesn't support the "removeNotFollowedSymlinks" attribute'

You need a recent version of ant (at least 1.8.0) to avoid such problems. If you cannot upgrade to a newer version, you may consider removing this attribute from the build.xml file.