Skip to content

Setting up Tetrad in IntelliJ IDEA

Joseph Ramsey edited this page Nov 30, 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.) If someone wants to add instructions for setting up Tetrad in Eclipse, feel free.

  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. Click OK until the project is set up. If it asks you to add git root, say yes. If it gives you a choice of Java versions, choose 1.7 or higher. Preferably 1.8. (Choose the most recent version if given a choice.) If it asks you whether you want to set it up as a Maven project, say yes. Please, say yes. You may need to tell it where you Java JDK is if you just downloaded one.

  8. Click Maven Projects on the right margin.

  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()'.

Please forgive; we have been working hard to fix up Tetrad so that it can be put out for public consumption; it was a lot less public for some 15 years. As a result, the repository has been changing a lot lately, and IntelliJ sometimes has trouble keeping up. If you're having problems, try the following:

(at the tetrad prompt:)

git pull https://github.com/cmu-phil/tetrad git reset --hard

Then delete all of the .iml files. (There are 3 of them.) Also, delete the entire .idea directory.

Then in IntelliJ, File->New->New repository from existing sources. Select the tetrad directory. Go through the setup process again. Accept root. Set up as a Maven project.

(at the tetrad prompt:) mvn compile

It should be reset back to normal.

Hopefully, things will normalize soon.