|
|
@@ -1,33 +1,154 @@
|
|
1
|
|
-## Installation
|
|
|
1
|
+## Windows
|
|
2
|
2
|
|
|
3
|
|
-You will need:
|
|
|
3
|
+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.
|
|
4
|
4
|
|
|
5
|
|
-* Java 8
|
|
6
|
|
-* Gradle
|
|
7
|
5
|
|
|
8
|
|
-### Java
|
|
|
6
|
+### Install Java Development Kit 1.8
|
|
9
|
7
|
|
|
10
|
|
-If typing `java -version` on the command-line returns `command not found` or similar, then go to [java.com](https://www.java.com/en/download/help/index_installing.xml), which will tell you how to install Java on your system.
|
|
11
|
8
|
|
|
12
|
|
-If Java is already installed, you will see something like the following, perhaps with some extra details about builds and virtual machines:
|
|
|
9
|
+First determine if you have Java installed already.
|
|
13
|
10
|
|
|
14
|
|
- java version "1.8.0"
|
|
|
11
|
+In a Command Prompt window (Start -> Command Prompt)...
|
|
15
|
12
|
|
|
16
|
|
-### Gradle
|
|
|
13
|
+```
|
|
|
14
|
+C:\Users\johndoe> java -version
|
|
|
15
|
+```
|
|
17
|
16
|
|
|
18
|
|
-On Mac OS X you can install Gradle using homebrew:
|
|
|
17
|
+if you see:
|
|
19
|
18
|
|
|
20
|
|
- brew install gradle
|
|
|
19
|
+```
|
|
|
20
|
+'java' is not recognized as an internal or external command,
|
|
|
21
|
+operable program or batch file.
|
|
|
22
|
+```
|
|
21
|
23
|
|
|
22
|
|
-On Windows you will need to visit the [Gradle](http://gradle.org/installation) website and follow the instructions there.
|
|
|
24
|
+You'll need to install the JDK — it contains both a Java Runtime and development tools.
|
|
23
|
25
|
|
|
24
|
|
-* Download the latest version (big green button)
|
|
25
|
|
-* Unpack the ZIP file, which will contain a folder (e.g. gradle-2.2.1)
|
|
26
|
|
-* Copy the folder to a convenient location
|
|
27
|
|
-* Add that location + `\bin` to your `PATH`
|
|
|
26
|
+1. Go to [Oracle OTN](http://www.oracle.com/technetwork/java/javase/downloads/index.html) and download the latest version of the JDK (at the time of writing, [JDK 8u45](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html))
|
|
|
27
|
+2. Run the installer, using all the defaults.
|
|
28
|
28
|
|
|
29
|
|
-Verify that it has been installed correctly by running:
|
|
|
29
|
+Verify that the install worked.
|
|
30
|
30
|
|
|
31
|
|
- gradle -version
|
|
|
31
|
+Close any open Command Prompt windows and in a *new* Command Prompt window...
|
|
32
|
32
|
|
|
33
|
|
-You should see a version number as well as some extra information about build time and dependencies.
|
|
|
33
|
+```
|
|
|
34
|
+C:\Users\johndoe> java -version
|
|
|
35
|
+```
|
|
|
36
|
+
|
|
|
37
|
+You should see something like this:
|
|
|
38
|
+
|
|
|
39
|
+```
|
|
|
40
|
+java version "1.8.0_45"
|
|
|
41
|
+Java(TM) SE Runtime Environment (build 1.8.0_45-b15)
|
|
|
42
|
+Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
|
|
|
43
|
+```
|
|
|
44
|
+
|
|
|
45
|
+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.
|
|
|
46
|
+
|
|
|
47
|
+### Install IntelliJ IDEA Community Edition
|
|
|
48
|
+
|
|
|
49
|
+Download, install and configure IntelliJ with the JDK you have installed:
|
|
|
50
|
+
|
|
|
51
|
+1. Download [IntelliJ IDEA Community Edition](https://www.jetbrains.com/idea/download/) and run the installer; accept all the defaults.
|
|
|
52
|
+
|
|
|
53
|
+2. Run IntelliJ (Start -> All Programs -> JetBrains -> IntelliJ IDEA Community Edition).
|
|
|
54
|
+ * The first time you do, IntelliJ walks you through some initial setup. We recommend selecting a UI Theme and then just clicking "Skip All and Set Defaults".
|
|
|
55
|
+
|
|
|
56
|
+3. In the "Welcome to IntelliJ IDEA" window, open the "Configure" pull-down and select "Project Defaults", then "Project Structure".
|
|
|
57
|
+
|
|
|
58
|
+3. In the "Default Project Structure" dialog, find the "Project SDK:" section in the right panel. Click the "New..." button and select "JDK".
|
|
|
59
|
+
|
|
|
60
|
+4. 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".
|
|
|
61
|
+
|
|
|
62
|
+5. Back in the "Default Project Structure" dialog, in the "Project language level:" section, select "8 - Lambdas, type annotations etc.". Click "OK".
|
|
|
63
|
+
|
|
|
64
|
+## Mac OS X
|
|
|
65
|
+
|
|
|
66
|
+If you are new-ish to programming in Java on Mac OS X, these instructions are for you.
|
|
|
67
|
+This is a step-by-step opinionated guide to getting from zero to submitting your first exercise.
|
|
|
68
|
+
|
|
|
69
|
+### Step 1 — Install Java Development Kit 1.8
|
|
|
70
|
+
|
|
|
71
|
+First, determine if the JDK 1.8 is installed:
|
|
|
72
|
+
|
|
|
73
|
+```bash
|
|
|
74
|
+$ java -version
|
|
|
75
|
+```
|
|
|
76
|
+
|
|
|
77
|
+What you do next depends on the output of that command.
|
|
|
78
|
+
|
|
|
79
|
+#### No JDKs Installed
|
|
|
80
|
+
|
|
|
81
|
+If you have no JDKs installed at all (e.g. you have a fresh install of Mac OS X 10.10 [Yosemite]),
|
|
|
82
|
+the OS presents a dialog:
|
|
|
83
|
+
|
|
|
84
|
+
|
|
|
85
|
+
|
|
|
86
|
+Clicking on the "More Info..." button takes you to the [Oracle OTN](http://www.oracle.com/technetwork/java/javase/downloads/index.html).
|
|
|
87
|
+
|
|
|
88
|
+Download the latest version of the JDK (at the time of writing,
|
|
|
89
|
+[JDK 8u45](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html))
|
|
|
90
|
+and run the installer, using all the defaults.
|
|
|
91
|
+
|
|
|
92
|
+Skip down to [Verify JDK Install](#verify-jdk-install)
|
|
|
93
|
+
|
|
|
94
|
+#### Older JDKs Installed
|
|
|
95
|
+
|
|
|
96
|
+If you see something like...
|
|
|
97
|
+
|
|
|
98
|
+```bash
|
|
|
99
|
+java version "1.6.0_65"
|
|
|
100
|
+Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
|
|
|
101
|
+Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
|
|
|
102
|
+```
|
|
|
103
|
+
|
|
|
104
|
+Or any version that is prior to 1.8, you need to install the 1.8 JDK...
|
|
|
105
|
+
|
|
|
106
|
+1. Go to [Oracle OTN](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
|
|
|
107
|
+and download the latest version of the JDK (at the time of writing,
|
|
|
108
|
+[JDK 8u45](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html))
|
|
|
109
|
+2. Run the installer, using all the defaults.
|
|
|
110
|
+
|
|
|
111
|
+#### Verify JDK Install
|
|
|
112
|
+
|
|
|
113
|
+Let's verify that the installation worked...
|
|
|
114
|
+
|
|
|
115
|
+```bash
|
|
|
116
|
+$ java -version
|
|
|
117
|
+```
|
|
|
118
|
+
|
|
|
119
|
+You should see something like this:
|
|
|
120
|
+
|
|
|
121
|
+```bash
|
|
|
122
|
+java version "1.8.0_45"
|
|
|
123
|
+Java(TM) SE Runtime Environment (build 1.8.0_45-b15)
|
|
|
124
|
+Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
|
|
|
125
|
+```
|
|
|
126
|
+
|
|
|
127
|
+The exact version number is not important, just that version 1.8 or better is installed.
|
|
|
128
|
+Circa 2004, Sun Microsystem, in their inifinite wisdom, decided that it would be "better" to
|
|
|
129
|
+have dual numbering conventions. Java 1.8 == Java 8.0.
|
|
|
130
|
+
|
|
|
131
|
+Congratulations, you've ensured you have the proper version of Java, itself, installed!
|
|
|
132
|
+
|
|
|
133
|
+### Step 2 — Install IntelliJ IDEA Community Edition
|
|
|
134
|
+
|
|
|
135
|
+Download, install and configure IntelliJ with the JDK you have installed:
|
|
|
136
|
+
|
|
|
137
|
+1. Download [IntelliJ IDEA Community Edition](https://www.jetbrains.com/idea/download/) and
|
|
|
138
|
+run the installer; accept all the defaults.
|
|
|
139
|
+
|
|
|
140
|
+2. Run IntelliJ (`/Applications/IntelliJ IDEA 14 CE.app`)
|
|
|
141
|
+ * The first time you do, IntelliJ walks you through some initial setup. We recommend
|
|
|
142
|
+ selecting a UI Theme and then just clicking "Skip All and Set Defaults".
|
|
|
143
|
+
|
|
|
144
|
+3. In the "Welcome to IntelliJ IDEA" window, open the "Configure" pull-down and select
|
|
|
145
|
+ "Project Defaults", then "Project Structure".
|
|
|
146
|
+
|
|
|
147
|
+6. In the "Default Project Structure" dialog, find the "Project SDK:" section in the right panel.
|
|
|
148
|
+ Click the "New..." button and select "JDK".
|
|
|
149
|
+
|
|
|
150
|
+5. In the "Select Home Directory for JDK" file open dialog, navigate to
|
|
|
151
|
+ `/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home`. Click "OK".
|
|
|
152
|
+
|
|
|
153
|
+6. Back in the "Default Project Structure" dialog, in the "Project language level:" section,
|
|
|
154
|
+ select "8 - Lambdas, type annotations etc.". Click "OK".
|