|
|
# How to setup your developer enviroment for course PB162
|
|
|
This article coveres setup of basic tools used in course [PB162 Programování v jazyce Java](https://is.muni.cz/auth/predmet/fi/pb162). They are:
|
|
|
|
|
|
* [JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html) (Java Developer Kit) - tools for compiling and running Java programs,
|
|
|
* version control system called [Git](https://git-scm.com/),
|
|
|
* ssh, more specifically [ssh key pair](https://en.wikipedia.org/wiki/Secure_Shell#Key_managementhttps://en.wikipedia.org/wiki/Secure_Shell#Key_management), used for communication between your git client and git server,
|
|
|
* tool for building project and managing it's dependencies called [maven](https://maven.apache.org/),
|
|
|
* IDE (Integrated Development Environment) of your choice.
|
|
|
|
|
|
Installation of those things is platform specific. You are probably familiar with Windows operating system. Let' start there.
|
|
|
|
|
|
## Setup on Windows
|
|
|
### Java - install JDK
|
|
|
Installation of JDK on windows is pretty straightforward.
|
|
|
Just download latest [JDK from Oracle](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) (**you need JDK, JRE is not enough**) and follow classic windows installation flow: next -> next -> next -> finish.
|
|
|
At some point during the installation, it will ask you, where to install java. Just keep defaults (probably `C:\Program Files\Java`).
|
|
|
_JDK contains java compiler and other tools for building project from source.
|
|
|
JRE is sufficient for running compiled java, you can't compile with it._
|
|
|
|
|
|
#### Java - Setup Enviroment variables
|
|
|
You need to setup following enviroment variables: `JAVA_HOME` and `PATH`.
|
|
|
Just google "windows set environment variable" or use [this guide](http://www.computerhope.com/issues/ch000549.htm).
|
|
|
|
|
|
* Add new variable (or edit existing one if exists) `JAVA_HOME`
|
|
|
and set it's value to `C:\Program Files\Java\jdk1.8.0_60`
|
|
|
**Double check if the path is correct for your system, it depends on version you downloaded and path you selected during JDK installation.**
|
|
|
* **edit** existing variable `PATH` - at the end append `;C:\Program Files\Java\jdk1.8.0_60\bin`
|
|
|
**again, double check if path is correct for your system**
|
|
|
|
|
|
### Version control system - Git
|
|
|
You will install both - command line program for working with git and GUI application called Source Tree.
|
|
|
#### Command line git
|
|
|
* Download "[Git for Windows Setup](https://git-scm.com/download/win)" (32 or 64 bit version, according to your system)
|
|
|
* Install it
|
|
|
* page "Adjusting your PATH enviroment" - _If you don't know, what theese choices means, choose "Use Git from Git Bash only"._
|
|
|
* page "Configuring the line ending conversions" - **choose Checkout Windows-style, commit Unix-style line endings**
|
|
|
* page "Configuring the terminal emulator to use with Git Bash - _if you don't know what it means, choose "Use MinTTY (the default terminal of MSys2)"_
|
|
|
|
|
|
#### GUI for Git
|
|
|
Download and install [SourceTree](https://www.sourcetreeapp.com/).
|
|
|
|
|
|
* When asked "Install global ignore file", click **yes**.
|
|
|
* When asked "Add an account" for bitbucket, click **Skip Setup**.
|
|
|
|
|
|
### Generate ssh key pair
|
|
|
**You can skip this step if you already have ssh key pair generated.**
|
|
|
|
|
|
You should have program "Git Bash" from previous step.
|
|
|
Open it (command line will show up) and type
|
|
|
`ssh-keygen.exe -b 2048 -C "your@email.cz"`.
|
|
|
You can leave defaults and just hit enter on following questions.
|
|
|
Output may look like this:
|
|
|
|
|
|
```bash
|
|
|
ssh-keygen.exe -b 2048 -C "your@email.cz"
|
|
|
Generating public/private rsa key pair.
|
|
|
Enter file in which to save the key (/c/Users/pepa/.ssh/id_rsa):
|
|
|
Created directory '/c/Users/pepa/.ssh'.
|
|
|
Enter passphrase (empty for no passphrase):
|
|
|
Enter same passphrase again:
|
|
|
Your identification has been saved in /c/Users/pepa/.ssh/id_rsa.
|
|
|
Your public key has been saved in /c/Users/pepa/.ssh/id_rsa.pub.
|
|
|
The key fingerprint is:
|
|
|
SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxk your@email.cz
|
|
|
The key's randomart image is:
|
|
|
....
|
|
|
```
|
|
|
|
|
|
### Install Maven
|
|
|
|
|
|
* Download latest Maven [Binary zip archive](https://maven.apache.org/download.cgi).
|
|
|
* Extract it to some meaning full place (for instance `C:\Program Files`).
|
|
|
* in this place should now be subfolder `apache-maven-3.3.3` (or any other version)
|
|
|
* from now on, this place is called your `M2_HOME`, alternatively `MAVEN_HOME`
|
|
|
* Setup both enviroment variables `M2_HOME` and `MAVEN_HOME`
|
|
|
* they should both point to `C:\Program Files\apache-maven-3.3.3`
|
|
|
* why both? some applicatins look for M2_HOME and some for MAVEN_HOME, therefore it's safer to have both ;)
|
|
|
* step by step guide [here](http://www.mkyong.com/maven/how-to-install-maven-in-windows/)
|
|
|
* edit your `PATH` enviroment variable
|
|
|
* append `;%M2_HOME%\bin` at the end
|
|
|
|
|
|
### Install IDE of your choice
|
|
|
|
|
|
Supported IDE for this course is [BlueJ](http://www.bluej.org/). It's very simple enviroment designed for beginners. Unfortunatelly it lacks some usefull features, like [Code completion](https://en.wikipedia.org/wiki/Intelligent_code_completion).
|
|
|
If you are looking for full featured IDE, take look at following choices:
|
|
|
|
|
|
* [IntelliJ Idea](https://www.jetbrains.com/idea/) - they provide free community edition, but you can contact [RNDr. Martin Kuba, Ph.D.](https://is.muni.cz/auth/osoba/makub?fakulta=1433;obdobi=5983;studium=518909) and ask him politely for Ultimate license.
|
|
|
* [Eclipse](https://eclipse.org/) - open source IDE, which is base for many other products, like
|
|
|
* [JBoss Developer Studio](http://www.jboss.org/products/devstudio/overview/) with additional support for Red Hat Middlewre products,
|
|
|
* [Spring Tool Suite](https://spring.io/tools) with additional Support for Spring framework,
|
|
|
* [Aptana Studio](http://www.aptana.com/) targeting mostly web development.
|
|
|
* [NetBeans IDE](https://netbeans.org/) - [doc. RNDr. Tomáš Pitner, Ph.D.](https://is.muni.cz/auth/osoba/tomp?fakulta=1433;obdobi=5983;studium=518909) used to code in this one ;)
|
|
|
|
|
|
[Which IDE is the best](https://jaxenter.com/eclipse-netbeans-or-intellij-which-is-the-best-java-ide-107980.html)? Well try them and choose one that you like most ;)
|
|
|
|
|
|
You may use any IDE, or just text editor or [Vim](https://en.wikipedia.org/wiki/Vim_(text_editor)) if you really want to. |