17 July 2018
Setting up a Java Dev Environment with IntelliJ
The great thing about ‘light weight’ languages is that they usually don’t require (or even suggest) the use of an IDE that helps complete all of the extra typing required of heavier weight languages such as C# and Java. The purpose of this post is to document the steps required to get going with a dev environment (spoiler alert: it’s more complicated than just installing a couple packages).
Download and Install the JDK
brew install java
Download and Install IntelliJ CE
Open your project from the terminal
cd MyJavaProject
idea .
Add the new SDK, JDK to IntelliJ
Ensure Java version under ‘project structure’ is set correctly
If Java 1.8, use ‘8’ as the dropdown menu, not 9….
Add Gradle?
gradle cleanIdea
gradle idea
Setup the play button
In the project explorer, expand
src -> main -> java -> project ID -> Application -> Run 'Application Main()'
From there on, the ‘Play’ and ‘Debug’ buttons in the IDE will play that application.
Create Debug Points
Click in a special spot in the middle of the gutter to create a breakpoint. Execution will pause there when using the ‘Debug’ button.
Categories: java - env-setup