# Idea notes * Handy links * Documentation overview: http://www.jetbrains.com/idea/documentation/documentation.html Online Help: http://www.jetbrains.com/idea/webhelp Reference card: http://www.jetbrains.com/idea/docs/IntelliJIDEA8_ReferenceCard.pdf * Startup * I start with a script containing the following => export IDEA_JDK="$JAVA_HOME" cd /my/webbed/jetbrains/idea-9164/bin IDEA_VM_OPTIONS=~/.idea_vmoptions export IDEA_VM_OPTIONS sh idea.sh <= It seems to be necessary to run from the actual directory. My ``~/.idea_vmoptions'' contains => -Xmx1g -XX:MaxPermSize=512m -ea <= The install of IDEA creates an enormous directory ``~/.IntelliJIdea8x/system/'' in my home directory. After stepping through the install wizard, I exit, move this directory to local disk and point to it with a symbolic link. Many plugins are blamed for freezes and hangs. I select only the few that I know I want, and postpone installing any others. * New Project from existing SVN repository *
    o Go to ``File -> New Project'' and select "Create Java project from existing sources." o I select a directory like ``$HOME/projects'' below the directory containing all repositories of interest. o I give the project a general name like "projects" because it will contain many independent repositories as modules. o I get a list of source directories, and unselect all the false postivies. Our correct directories are usually named "src" and contain directories like "com", "edu", and "gov". o If I plan to use existing module files ``*.iml'', then I unselect all directories at this point. o Next you must "review libraries." Select the ones that contain essential third-party applications. Ours are usually called "jar" and contain "jogl.jar" and so on. Unselect any duplicates of these jars in built images. Prefer the ones used by ant "build.xml". Again, if I plan to use existing module files ``*.iml'', then I unselect all libraries at this point. This is easier if you hit the "stop searching" button right away. o Next it will suggest "module" names for each of the respositories I have under "projects". These are generally correct. If you have unselected source and libraries, then this list will be empty. o You must select a JSDK. o Hit "finish." o First chance you get, set ``File -> Settings -> HTTP Proxy'', if you have one. Also set ``File -> Settings -> Web Browsers''. o This is a good time to shut down and move ``~/.IntelliJIdea8x/system/'' to another directory, with a symbolic link from the original location. o Go to ``File -> Settings -> Updates -> Check now'' and get the IDE update out of the way. o Before adding modules to very large projects, you may want to disable automatic updating from the file system. This often causes IDEA to hang for me. Go to ``File -> Settings -> General'' and uncheck "Synchronize files on frame activation." o It is easy to add additional modules now. Select ``File -> New Module -> Create module from scratch'' and hit Next. Choose a name and path as before. It may only ask for your source path. o Alternatively, ``Select File -> Import existing module -> Select IDEA module (.iml) to import''. At my office, many repositories provide these in the top directory.
You should now see new ``projects.iws'' and ``projects.ipr'' files in your top level projects directory. * Configuring modules * __ o You should see all your modules on the Project panel on the left. o I prefer to select "View as: Packages" o Right click on a module and select "Module Settings." o Check the "Sources" tab on the right and exclude any incorrect sources that may have been included. o Check the "Paths" tab on the right and "Use module compile output path" consistent with your own build scripts. The default build path is an "out" directory _ * Other useful settings * __ o Go to the menu bar ``File -> Settings -> Editor -> Code Style -> Imports'' and under "General" click "Optimize imports on the fly" and "Add unambiguous imports on the fly." o Go to the menu bar ``File -> Settings -> Compiler -> Java Compiler'' and increase "Maximum heap size (MB)" o Go to the menu bar ``Run -> Edit Configurations'' and set "VM parameters" to ``-ea -Xmx600m''. o Go to ``File -> Settings -> Inspections'' and spend and hour deciding what warnings you want to see. o I go to ``File -> Settings -> Editor -> Code Style -> Java -> Arrangement tab'' and set the following rules for sorting code: __ o field, public, static, final o field, protected, static, final o field, package private, static, final o field, private, static, final o field, public, static o field, protected, static o field, package private, static o field, private, static o interface o enum o initializer block, static o field, public, final o field, protected, final o field, package private, final o field, private, final o field, public o field, protected o field, package private o field, private o field o initializer block o constructor o method, public, static o method, public o method, static o method o class, static o class _ _ Bill Harlan, 2008-2009