Source:Trouble

From Wiketomica
Jump to: navigation, search

If you are having trouble getting etomica to compile or run in Eclipse, this page provides helpful hints on how to get it working.

Unfortunately, it's pretty common to bring the etomica source into Eclipse in a way that Eclipse doesn't understand. In the Package Explorer view, you should see a top-level folder for each project. If you've checked out the Core, Apps and Graph projects, then you should have etomica, etomica.apps and etomica.graph (if you named them differently, that's OK, so long as they're all there). Under each top-level folder should be an "src" folder and another item, "JRE System Library". If you have an etomica folder directly under the project, then the checkout did go well (see item 4.6). Inside the src folder, you should have an etomica folder. If all of that looks OK, then your CVS checkout went well.

The next thing to check for is that Eclipse is able to compile etomica. There are a few symptoms you can look for. If you open up a project in the package explorer and navigate src->etomica-> etc. until you get to a class (Anything.java), you should notice that many of the "J" icons next to the class have a very small yellow triangle with an exclamation mark inside (Warning co.png). This is a sign that Eclipse has successfully compiled etomica. The yellow marks are just warnings. What you might see instead:

  1. If you see a red exclamation mark (Error co buildpath.png) anywhere, try to fix that first before proceeding to #2 or #3. This is not typically a problem when you're first starting, but sometimes you'll get this after making a change. The red exclamation mark usually indicates a missing build dependency, either a library or a project. You previously specified that project A depended on library B (or project B) and then library B disappeared. If this happens, Eclipse will not attempt to compile any files in project A. You can go to the build dependencies (right click on project -> Properties -> Java Build Path -> (Projects or Libraries tab) and fix it there. The specific problem should be highlighted again with a red exclamation mark.
    • A red exclamation mark can also be caused by circular build dependencies. If project A depends on project B, then project B cannot depend on project A. See the Source:Extra page for how to set project dependencies properly.
  2. All files (or almost all files) have a small red box with a white x (Error co.png). This means that Eclipse tried to compile the file but was unsuccessful. This may be due to missing libraries or missing dependencies between projects. You can open the file (double-click) and look for parts of the code with a red underline or look for red marks in the right margin. More details on dependencies are available for project dependencies and library dependencies.
    • If a few files have red boxes with an x, that is OK, especially if the files are not the ones you need . It's a missing library or project as described above, but Eclipse will just ignore them so long as you don't try to run something that needs them.
  3. No java files have any yellow triangles or red boxes. This probably means that Eclipse is not even trying to compile your files. This is often due to the files not being under src, but might also be due to missing build dependencies (there is probably a red exclamation mark somewhere; see #1).