In this article I show you how to install the MembraneEditor from source using Eclipse. For an experienced user of Eclipse, this is a task which takes ca. 5 minutes. This tutorial explains in detail every step also for people not familiar with Eclipse.
Make sure you have installed:
Java JRE from e.g. http://www.java.com
On many systems this is pre-installed. In addition it is possible to download it together with Eclipse in the next step. For Linux usually it is better to choose the original Sun Java instead of alternative Java version. But it may run also with the alternatives.
Eclipse for/with Java (the project runs also on very old version like 1.3) from e.g. http://www.eclipse.org/downloads/
Finally, download Java3D from http://java3d.java.net/binary-builds.html/
It is recommended to choose version 1.5.2 which is not available from Oracle.
Import and Compile the Project
The source code can be downloaded from:
Please always choose the newest version.
After you have downloaded the ZIP file, extract the contained files.
Now open Eclipse. Right click into the package explorer onto an empty position (make sure you do not selected accidently another already imported project) and choose "Import".
In the appearing menu, choose "General -> Existing Projects into Workspace".
Choose the folder which you have extracted before. Make sure that the selected folder contains the folder "org" , otherwise Eclipse will not find the project file. Click "OK".
Now the Import dialog should look like this:
Select "copy projects into workspace" if you want to copy the whole project into the workspace. (Otherwise Eclipse will use the extracted folder as source and you can not delete this folder again without destroying the project.)
Make sure that in Projects the folder "Cm2_2" is selected. This is the project to be imported. Click on "Finish".
Now your package explorer should look like this:
Note that there is an exclamation mark found besides the "Cm2_2" folder. This indicates that some libraries are not linked correctly. The reason is that usually your Java libraries are found on another location than on the computer the project originally was exported. But this is not problem. Right click onto "Cm2_2" in the Package Explorer and choose "Properties".
Choose "Java Build Path" in the left menu. Choose the tab "Libraries" in the right menu. Note the error mark besides the Java library and the "unbound" information: there is not Java library found in the predefined location. Select it and click on "Remove".
Click on "Add Library", select "JRE System Library" and select now a Java library which is installed on your computer. Usually you can choose "Workspce default ...". The MembraneEditor is compatible to Java 6 and, starting with version 2.2.1_2, also to Java 7 (there were only minimal problems before). After selecting the Java library, click on "Finish".
You will see: the exclamation mark disappeared. Click "Okay".
If there are no more error messages by now, you can skip the next step:
Usually, there should be not compiler problems by now. But sometimes Eclipse uses some strange settings for the Java version. And in this cases, you have to do the following:
Richt click on the project in the Package Explorer. Choose again "Properties". Select "Java Compiler" on the left side of the window. Check the Java version stated for "Compiler compliance level". Here should be written "1.6" in the best case, "1.7" works also. But e.g. "1.4" will not work. In this case, select "Enaple project specific settings". The choose the appropriate Compiler compliance level (1.6 is recommended). Click "Okay".
Make sure that Eclipse recompiles the project by choosing "Procect -> Clean ..." and press okay in the clean dialog. Now all errors should be disappeared.
On some systems (usually only Windows XP), the project may run now. Just try to start it. Navigate in the Package Explorer to org.cellmicrocosmos.cm2.Start.java:
Right click on the project and select "Run as ... -> Java application":
If you are lucky, the project will already start, because Java 3D was linked with Java properly. But usually, especially on Linux or Windows 7, this will not work. But this problem is solved very easily: Define the location of the Java 3D binary file. (Skip the following step if you succeeded in starting the MembraneEditor.)
For this purpose, you have to link the Java 3D binary file with Java. Right click again onto the project in the Package Explorer and open the properties. On the left side, select Java Build Path. On the right side, double click on the "Native library location" found in the Java library (e.g. "JRE System Library [jre6]"). Now navigate here to the folder where the binary file of Java 3D is found:
Windows 7: Make sure that you use a 32 bit version of Java 3D if you use a 32 bit version of Java and a 64 bit version of Java 3D with a 64 bit version of Java.
C:\Program Files (x86)\Java\Java3D\1.5.2\bin
Now you can run the MembraneEditor by starting the Start.java stated above. In addition you can now read the section Tune the MembraneEditor! Part I: Fun with Java Heap Space.
Moreover, if you own a nVidia Quadro FX card and 3D-Stereoscopy-compatible monitor, it is about time to activate the 3D mode! Go to Tune the MembraneEditor! Part II: Fun with 3D-Stereoscopy.