(Credit for this document goes to Tim Kutcher, TA from 226Spring19)

Hey all,


Project Setup

Project Structure - Inside Project Settings select Project - Your Project SDK should be set to 8 - In the Project language level select 8 - For Project compiler output click the little folder icon then select the classes/ folder we made - IntelliJ basically wants to know where to write the .class files too when compiling, and know where to look for them when running - So we are just telling it where we want to keep our class files (separate from our source files) - Hit Apply and OK - The last thing we need to do is tell IntelliJ where our java files are - Right-click on homework/ folder you created and then Mark Directory as…Sources Root - Now, that folder should turn blue, and the hw1 folder should have the little package icon. - Now all the java files should be able to find each other, etc. - The classes folder should be red - At the bottom, if you select Terminal you should get a shell at the bottom open to the cs226 folder.

Compiling and Running

Integrating Checkstyle




These are just some wildcard cool-tricks to use while editing - If anything is highlighted or red, option/alt+click will give you options to fix - Command+click on any variable will take you to that variable declaration - Command+click on any type/class will take you to that class - Command+click on any method call will take you to that method - If you want to change a variable or method name, right click on it and select Refactor… and Rename - For Javadoc, if you type /** above the method and hit enter/return, it will give you skeleton Javadoc - At the bottom you can click TODO and it will give you a list of everywhere there is a TODO item. For homeworks you want to make sure you do all of these. - If you use markdown for your README, as you write in a .md file it will automatically show you the render next to it.