Skip to content

Setting up Tetrad in IntelliJ IDEA

Joseph Ramsey edited this page Dec 23, 2015 · 33 revisions

If these instructions don't work for you, please let us know. (Just open an issue at https://github.com/cmu-phil/tetrad/issues.) Please say what versions of Java and IntelliJ IDEA you are using, let us know which step didn't work, and give a brief description.

  1. Google, download and install the latest IntelliJ IDEA CE (free). The IDEA version needs to be at least version 15 for these instructions to work.

  2. If you don't have the latest Java installed, install it. Google "oracle java download" and choose the latest JDK for your platform. The Java version needs to be at least version 1.8.

  3. Fork the Tetrad repository and clone it to your desktop. Figure out where it went. On a Mac, it went to your Documents folder.

  4. Open up IntelliJ.

  5. Select File->New->Project from Existing Sources.

  6. Find the folder for the Tetrad project you just cloned to your desktop. Select the "pom.xml" file just inside of it. (Careful, there are "pom.xml" files inside of subfolders. Don't pick those.)

  7. Press return repeatedly until the project is set up. That is, accept all of the defaults unless you are smarter than the defaults. If it gives you a choice of Java versions, choose the latest, 1.8 or higher. If you don't have a Java version in the list, you will have to click the + and select the location where the most recent Java you just installed was installed to. You can google it--e.g. google "java install location mac".

  8. Click Maven Projects on the right margin. If you don't see it, click the gray button in the lower left corner of the IntelliJ window to reveal it.

  9. Double click Tetrad->Lifecycle->compile. This operation may take a while. It has to download all of the dependent jars etc.

  10. From the Navigate menu select Class...

  11. Type "Tetrad"; select Tetrad in edu.cmu.tetradapp.

  12. When the class comes up in the editor, right-click (command-click) on the name of the class ("Tetrad") and select Run 'Tetrad.main()'. You want to right click on the word "Tetrad" that follows the words "public final class".