It's about time I wanted to do server-side, Windows Application, and Android development with Java, so I decided to introduce an integrated development environment.
Initially, I was planning to install Eclipse, but I stumbled upon the JUnit settings </ s>, and I had a lot of thoughts, so I decided to install IntelliJ.
It seems to be proud of 2nd share next to IntelliJ and Eclipse, and above all, I like the modern UI.
It seems that the execution speed of Eclipse becomes slow as soon as it is set to the Japanese environment.
As an aside, I learned about Netbeans after building the environment.
O S:Windows8.1 Pro(x64) CPU:Core i5-4300M CPU 2.60GHz RAM:4.00GB JDK:8u121(Windows x64)
Download IntelliJ from here (https://www.jetbrains.com/idea/). It seems that IntelliJ has a paid version and a free version, but this time I chose the free version. See here for more details.
- Should I choose Community (free) or Ultimate (paid)? If you just want to develop Java, Groovy, Scala or Android applications, use the open source and free IntelliJ IDEA Community Edition. When developing web applications and enterprise applications, we recommend Ultimate Edition, which comes with a number of tools and has extensive framework support. You can also try it for free for 30 days.
Run the downloaded installer. Basically, if you follow the message, you should not be confused by the installation itself.
Select below if you do not want to import settings.
Select "Accept".
The tutorial starts.
Create a new project from "Create New Project".
Here, select "Java" to create a project, but ... Since the JDK environment is not ready, move on to the JDK settings from here.
Install J </ strong> avaSE D </ strong> evelopment K </ strong> it.
The version at the time of writing was 8u121. Download the latest version of the JDK from here. Click "Accept License Agreement" and download the one that suits your environment.
Proceed with the installation. This area is omitted. Make a note of only the installation destination, as it will be required for the work through the next path. Reference: C: \ Program Files \ Java \ jdk1.8.0_121 \ bin
After installing the JDK, add the environment variable Path.
Invoke the "System" screen.
Call the "System Properties" screen from "Detailed System Settings". Click "Environment Variables" at the bottom of the "Detailed Settings" tab.
When the "Environment Variables" screen opens, select "Path" in "System Variables" at the bottom of the screen. After selecting, click "Edit".
Enter; at the end of "Variable value" and copy and paste the path to the JDK that you wrote down earlier. When there are multiple variables, multiple variable values can be set by separating them with ";". Refer to this area.
From the command prompt
java -verison
Enter. If the version is displayed, there is no problem. If something goes through but I'm throwing an error, I restarted it for the time being (experience story).
Try creating a project from IntelliJ again.
Create a project from "Create New Project" as usual. Select "Java" and select "JDK" from "New" on the right side of "Project SDK".
Select the local JDK path you just installed and click OK.
The screen will return to the original screen, so select the JDK you set earlier from the list box. After selecting, click the "Next" button.
Click "Next" without playing with it.
Enter the project name and click "Next".
Right-click "src" in the project and select "New"-> "Java Class".
Write a class (calc) appropriately.
public class calc {
public int sum(int x, int y)
{
return x + y;
}
}
Right-click on the project → select "New" → "Directory".
Enter the directory name.
Select "Files"-> "Project Structure".
Select "Modules" from the left menu, right-click on the Tests created earlier, and select "Tests".
Right-click on the created Class "calc" source code. Select "Go To" → "Test".
Select "Create New Test ...".
Select JUnit 4 from "Testing library". Check "startUp / @ Before" and "tearDown / After". Also check the functions in Member. Click the "Fix" button next to "JUnit 4 library not found in the module".
A window will be displayed, so check "Use'JUnit4' ..." and click "OK".
Write the test on the newly generated module.
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class calcTest{
@Test
public void sum() throws Exeption {
calc obj = new calc();
assertEquals(1, 1 + 1);
}
}
Select the upper tab "Run"-> "Run"-> "calcTest" to execute. Alternatively, use the shortcut key "Alt + Shift + F10" to execute.
Rewrite the code so that it passes on the green and execute it.
The author was exhausted around here. We will quietly borrow the wisdom of our predecessors. As a matter of fact, I haven't really understood the feeling of Git yet, so that's a topic for the future.
Aye! Integrated development environment Yatter! … But to be honest, I can't deny the feeling that it is still being used for its functions. It will take a long time to get used to it because it is multifunctional. In the first place, getting used to Java coding itself is one of the challenges ... I wish I could make something interesting with Java as well as getting used to it.
Recommended Posts