Electric is written in the Java programming language and is distributed as a single ".jar" file,
typically called "electric.jar".
There are two variations on the ".jar" file: with or without source code.
Either of these files can run Electric, but the one with source-code is larger because it also has
all of the Java code.
Electric requires Java version 1.3 or later.
It has been tested with Java version 1.5.
If you extract the source code from the ".jar" file and wish to build Electric, note that there are
some Macintosh OS/X issues to consider.
- Build on a Macintosh
The easiest thing to do is to remove references to "AppleJavaExtensions.jar" from the Ant script
(build.xml).
This package is a collection of "stubs" to replace Macintosh functions that are unavailable elsewhere.
You can also build a native "App" by running the "mac-app" Ant script.
This script makes use of files in the "packaging" folder.
- Build on non-Macintosh, for non-Macintosh
If you are building Electric on and for a non-Macintosh platform,
remove references to "AppleJavaExtensions.jar" from the Ant script
(build.xml).
Also, remove the module "com.sun.electric.MacOSXInterface.java".
It is sufficient to delete this module, because Electric automatically
detects its presence and is able to run without it.
- Build on non-Macintosh, for all platforms
To build Electric so that it can run on all platforms, Macintosh and other,
you will need to keep the module "com.sun.electric.MacOSXInterface.java".
However, in order to build it, you will need the stub package "AppleJavaExtensions.jar".
The package can be downloaded from Apple at
http://developer.apple.com/samplecode/AppleJavaExtensions/AppleJavaExtensions.html.
Memory Control
One problem with Java is that the Java Virtual Machine has a memory limit.
This limit prevents programs from growing too large, and speeds up garbage collection.
However, it prevents large circuits from being edited.
If Electric runs out of memory, you can request that more be used.
To do this, use "General" preferences (in menu File / Preferences..., "General" section, "General" tab).
At the bottom of the dialog is a memory limit field.
You will have to quit Electric and restart it for the new memory limit to take effect.