If you are new-ish to programming in Java, these instructions are for you. This is a step-by-step opinionated guide to getting from zero to submitting your first exercise.
First determine if you have Java installed already.
In a Command Prompt window (Start -> Command Prompt)...
C:\Users\johndoe> java -version
if you see:
'java' is not recognized as an internal or external command,
operable program or batch file.
You'll need to install the JDK — it contains both a Java Runtime and development tools.
Verify that the install worked.
Close any open Command Prompt windows and in a new Command Prompt window...
C:\Users\johndoe> java -version
You should see something like this:
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
The exact version number is not important, just that version 1.8 or better is installed. Circa 2004, Sun Microsystem, in their inifinite wisdom, decided that it would be "better" to have dual numbering conventions. Java 1.8 == Java 8.0.
Download, install and configure IntelliJ with the JDK you have installed:
Download IntelliJ IDEA Community Edition and run the installer; accept all the defaults.
Run IntelliJ (Start -> All Programs -> JetBrains -> IntelliJ IDEA Community Edition).
In the "Welcome to IntelliJ IDEA" window, open the "Configure" pull-down and select "Project Defaults", then "Project Structure".
In the "Default Project Structure" dialog, find the "Project SDK:" section in the right panel. Click the "New..." button and select "JDK".
In the "Select Home Directory for JDK" file open dialog, navigate to "C:\Program Files\Java\jdk1.8...". Be sure to select the JDK, not the JRE. Click "OK".
Back in the "Default Project Structure" dialog, in the "Project language level:" section, select "8 - Lambdas, type annotations etc.". Click "OK".
If you are new-ish to programming in Java on Mac OS X, these instructions are for you. This is a step-by-step opinionated guide to getting from zero to submitting your first exercise.
First, determine if the JDK 1.8 is installed:
$ java -version
What you do next depends on the output of that command.
If you have no JDKs installed at all (e.g. you have a fresh install of Mac OS X 10.10 [Yosemite]), the OS presents a dialog:
Clicking on the "More Info..." button takes you to the Oracle OTN.
Download the latest version of the JDK (at the time of writing, JDK 8u71) and run the installer, using all the defaults.
Skip down to Verify JDK Install
If you see something like...
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
Or any version that is prior to 1.8, you need to install the 1.8 JDK...
Let's verify that the installation worked...
$ java -version
You should see something like this:
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
The exact version number is not important, just that version 1.8 or better is installed. Circa 2004, Sun Microsystem, in their inifinite wisdom, decided that it would be "better" to have dual numbering conventions. Java 1.8 == Java 8.0.
Congratulations, you've ensured you have the proper version of Java, itself, installed!
Download, install and configure IntelliJ with the JDK you have installed:
Download IntelliJ IDEA Community Edition and run the installer; accept all the defaults.
Run IntelliJ (/Applications/IntelliJ IDEA 14 CE.app)
In the "Welcome to IntelliJ IDEA" window, open the "Configure" pull-down and select "Project Defaults", then "Project Structure".
In the "Default Project Structure" dialog, find the "Project SDK:" section in the right panel. Click the "New..." button and select "JDK".
In the "Select Home Directory for JDK" file open dialog, navigate to
/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home. Click "OK".
Back in the "Default Project Structure" dialog, in the "Project language level:" section, select "8 - Lambdas, type annotations etc.". Click "OK".
This is not a guide about how to learn to use Eclipse. Please, consult your favorite search engine for that because there are plenty of tutorials already available.
Once you've got Eclipse installed and running, there are at least two ways to get exercism tasks into Eclipse: Letting gradle build Eclipse workspace for you and using Buildship Gradle plugin for Eclipse.
Firstly, a simpler way of doing things.
Fetch an exercise: exercism fetch java <exercise>
(see the list of available exercises).
Change to the directory containing the exercise: cd ~/exercism/java/
<exercise> (by default things will end up in ~/exercism).
Let Gradle prepare things for Eclipse: gradle eclipse.
Start Eclipse.
From the "File" menu select "Import".
Select "Existing Projects Into Workspace" as import source.
Browse the directory containing the exercise fetched during the step 1 to "Select root directory:".
Hit the button labeled "Finish".
Secondly, a slightly more difficult, but more "Eclipseish" way of doing things. This is for those who absolutely despise doing anything away from Eclipse.
In case you've been reading about the Gradle STS plugin, note that The Buildship Gradle Integration plugin replaces the Gradle STS plugin which is no longer maintained.
Start (or restart) Eclipse after the plugin has been installed.
Fetch an exercise: exercism fetch java <exercise>
(see the list of available exercises).
From the "File" menu select "Import".
Select "Gradle" > "Gradle Project" as your import source.
Browse the directory containing the exercise fetched during the step 1 to the "Project root directory:".
Hit the button labeled "Finish".
To me it seems that the simple way of doing things is, as usual, the better
way of doing things. The only caveat I've found this far is that you have
to run gradle eclipse every time you change something affecting Eclipse.
For most exercises there is no need to ever touch build.gradle or anything else besides the source files, so this looks like a minor hassle not often encountered.