Chapter 1: Introduction
plug
1-4: Building Electric from Source Code
1-4-2: Source Code in the JAR Files
plug


Two Electric downloads are available from the Free Software Foundation (GNU): with and without source code. Therefore it is possible to build Electric from the source code in the download. Note, however, that this is not the preferred way to access the source code because it does not include the various dependencies. The preferred way to access the source code is to use Subversions and to access the code on savannah.gnu.org (see the next three sections for more).

To extract the source code from the ".jar" file, place it in its own directory, change to that directory, and run the following command:
    jar xf electric-version.jar
(Windows users may want to install "cygwin," from www.cygwin.com, in order to more easily run "jar" and other commands.) The "jar" command will create a number of files and folders on your disk:

The next step is to get a version of Java that can build source code. Although a "JRE" (Java Runtime Environment) is sufficient for running Electric, it is not able to build the source code. For that, you must have a "JDK" (Java Development Kit). In addition, you may want to use an IDE (Integrated Development Environment) such as NetBeans (at www.netbeans.org) or Eclipse (at www.eclipse.org).

Using the Command Line

"Ant" is a scripting system for building Java programs, and Electric comes with an Ant script called "build.xml". Once the source code is extracted, you can rebuild Electric simply by typing "ant". Before you do that, there are some considerations:

Running under Eclipse

Here are some notes about building Electric under Eclipse:


Prev Previous     Contents Table of Contents     Next Next