This forum is aimed towards anybody who is working with the the MembraneEditor. Installation instructions are found here. Any questions, remarks or critics are welcome. Also this is a chance to get in contact with other users.
Post Reply
User avatar
bjoern
Site Admin
Posts: 210
Joined: 20.03.2006, 15:01
Contact:

Install the MembraneEditor from Source with Eclipse

Post by bjoern » 07.07.2012, 11:02

Introduction

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.


Requirements

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:

http://www.cellmicrocosmos.org/index.php/download

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".
file_004.png
Eclipse: Import Project
file_004.png (28.71 KiB) Viewed 16099 times
In the appearing menu, choose "General -> Existing Projects into Workspace".
file_008.png
Eclipse: Import Dialog
file_008.png (30.74 KiB) Viewed 16099 times
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".
file_003.png
Eclipse: Search Folder
file_003.png (12.34 KiB) Viewed 16099 times
Now the Import dialog should look like this:
file_011.png
Eclipse: Import Project
file_011.png (23.83 KiB) Viewed 16099 times
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:
file.png
Eclipse: Project Imported
file.png (26.25 KiB) Viewed 16099 times
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".
file_014.png
Eclipse: Choose Properties
file_014.png (36.76 KiB) Viewed 16099 times
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".
file_005.png
Eclipse: Select Java Library
file_005.png (47.51 KiB) Viewed 16099 times
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".
file_009.png
Eclipse: Choose Workspace Default
file_009.png (20.51 KiB) Viewed 16099 times
You will see: the exclamation mark disappeared. Click "Okay".
file_002.png
Eclipse: Java imported
file_002.png (46.47 KiB) Viewed 16099 times
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".
file_007.png
Eclipse: Java Compiler
file_007.png (31.72 KiB) Viewed 16099 times
Make sure that Eclipse recompiles the project by choosing "Procect -> Clean ..." and press okay in the clean dialog. Now all errors should be disappeared.
file_013.png
Eclipse: Clean Project
file_013.png (16.9 KiB) Viewed 16099 times
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:
file_006.png
Eclipse: Start
file_006.png (53.43 KiB) Viewed 16099 times
Right click on the project and select "Run as ... -> Java application":
file_012.png
Eclipse: Run as
file_012.png (64.83 KiB) Viewed 16099 times
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 XP:
C:\Programme\Java\Java3D\1.5.2\bin

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.
64 bit:
C:\Program Files\Java\Java3D\1.5.2\bin
32 bit:
C:\Program Files (x86)\Java\Java3D\1.5.2\bin

Linux (Ubuntu):
usr/lib/jni
file_010.png
Eclipse: Java 3D Binary
file_010.png (55.23 KiB) Viewed 16099 times
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.

Post Reply