IntelliJ Guide For Eclipse Users

  1. Download free IntelliJ Community Edition or Ultimate (30-day trial)
  2. We are using Gradle so Community Version can be good enough for our development but free version doesn’t have support for frameworks like Spring so it could cause problems.
  3. There is also Google version -> Android Studio, but I don’t think it’s good for Java or Java EE development
  4. Gradle, Groovy, Maven etc. are supported as a standard, no additional plugins needed
  5. You may need to add Gradle_Home and Java_Home for gradle: File-> type: “Gradle” in search field and add them
  6. Here is official tutorial for Eclipse users and below you can find some articles “why IntelliJ is better” etc.
    1. Why I prefer IntelliJ IDEA over Eclipse
    2. Why we dropped Eclipse in favour of IntelliJ
    3. Why IDEA is Better
    4. Features
  7. Project Explorer looks different, works different with multiple projects, check here and here
  8. Change Keymap/shortcuts to Eclipse like: File-> Settings -> Keymap -> Keymaps: Eclipse or for eg. Netbeans
  9. Still some shortcuts will be different, so remember for eg. alt+insert for generating costructors, getters, setters etc. alt+enter for edit current line etc.
  10. Importing project: 2x Shift -> type: “Import Project” -> Choose project -> Choose Gradle model -> next -> Finish
  11. Run Configurations Arguments:
    1. There is green run button on the right side of IntelliJ, first you need to add there what you want to run or you can find it here Run -> Edit Configurations
    2. Then you can edit configurations, there are Program arguments and VM options
    3. Don’t forget to save your confgurations
    4. There are also VM Defaults arguments in JRE: File-> Settings -> type “jre” in search field -> edit VM options
  12. Java Compiler -> Eclipse is using own compiler, IntelliJ is using Javac, you can change it here: File-> Settings -> type “java compiler” in search field -> change field “Use compiler:” , Eclipse compiler makes less errors, check here
  13. You may have problems with running tests in Spring, if IDE can’t find configuration .xml files you can try this: @ContextConfiguration(locations = { “classpath*:path})
  14. I got a problem with running integration tests with IntelliJ and spring, I found solution a that IntelliJ is reading context.xml files from src/test/resources. I got it in the different folder, so probably you will need to adjust IntelliJ to read these properties from correct folder or just copy them into src/test/resources.
  15. IntelliJ got similiar Debugger, JUnit View, Gradle Task View etc.
  16. IntelliJ probably will add some own files, so you will need to add them to .gitignore
  17. Auto Scroll from Source: like Eclipse, Project Explorer can follow with our moves
  18. IntelliJ got own plugins available here: File-> Settings -> Plugins -> Browse Repositories…
    1. Key Promoter Plugin – can help you to remember shortcuts
    2. Eclipser – will help you to export run configurations from eclipse to idea
    3. Eclipse Code Formatter – allows using eclipse code formatter
    4. Save actions – same thing llke Eclipse
    5. Shortcut Translator – input shortcut from Eclipse and it will translate it to the idea one
    6. Springirun – some support for Spring
    7. Spock Framework Enhancements – got live code templates for Spock
    8. AngularJS – support for framework
    9. Check other plugins: here
    10. Official website with plugins
  19. Keyboard shortcuts you don’t want to miss: eg. 2x Shift – “Search Everywhere” or ctrl-alt-shift-J – “insert live template”
  20. For each code templates
  21. Classic Eclipse Colour Theme
  22. Bonus: Presentation: 42 IntelliJ IDEA Tips and Tricks in 45 Minutes
  23. Gradle script which will help you if you have integration tests in different directory than ‘test’ :
task copyTestResources(type: Copy) {
    from "${projectDir}/src/integration/resources"
    into "${buildDir}/classes/test"
}
processTestResources.dependsOn copyTestResources

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s