IntelliJ IDEA 13 trial note (with a detailed screenshot)

Source: Internet
Author: User

Since the beginning of last year, I have been looking for a weapon. Although eclipse is the first choice for many java programmers, I find that once some plug-ins are installed, after the number of projects in the workspace reaches 10, it often crashes, which affects the programming mood.

Today, I tried IntelliJ IDEA 13, which has won a lot of praise in recent years. The record is as follows:

 

Download and install

Http://www.jetbrains.com/idea/download/ this is the official website, support mac/windows/linux three major platforms, I try mac version today

Note:IntelliJ IDEA is a commercial software with two versions,

Ultimate Edition is a commercial Edition with complete functions. It can be used for free for 30 days. We recommend that you download this version for learning;

Community Edition is a free Community version with reduced functionality and can be used for google android development.

In addition:IntelliJ IDEA 13 on mac does not support jdk1.7. If you have installed oracle jdk1.7 on mac, recover it to the jdk 1.6 that comes with apple (for the restoration method, refer to here)

 

Preference settings

Skin/font settings

Nowadays, more and more ides like black colors, and IntelliJ IDEA is catching up with this trend. After IDEA is enabled for the first time, the following interface is displayed:

Click the "right" arrow next to Configure and select "Preferences" (reference)

In the search box at the top left corner, enter "Appear" (IntelliJ IDEA is intelligent and will match Appearance immediately). For details, refer:

Switch Theme to "Darcula", and adjust the default font to "DialogInput" and "12" to avoid Chinese garbled characters. Click OK to finish.

 

Maven settings

After the black style skin is set, IntelliJ IDEA will restart. Similarly, in preference settings, find maven settings. For details, refer to setting Maven home directory.

Note:If the M2_HOME environment variable is set on the mac, IntelliJ IDEA uses the M2_HOME environment variable value as the Maven main directory by default. If the M2_HOME environment variable is not set, you need to go to the interface, select Override and select the local Maven path.

 

Application server Settings

IntelliJ IDEA has built-in support plug-ins for almost all mainstream Application servers. It is to add Jboss EAP 6.2Weblogic 12.1.2.0.0

 

Keymap (shortcut key) settings

In the keyboard solution, I found that there is a Visual Studio solution, and the. NET background programmers are blessed :)

 

Create a Project

First, create a new Project.

Note:Projects in IntelliJ IDEA are not real projects.Solution in visual studio is a concept

Here we select an Empty Project, which is equivalent to creating an Empty workspace in eclipse or a blank solution in visual studio, and then entering the Project Name in the following interface

After you click Finish, because it is only an empty shell and there is nothing in it, a dialog box will pop up. Let's add a Module. Here we are not busy adding a Module. Let's set the JDK of the Project first, refer to setting JDK 1.6 for the entire Project.

At this point, the Project has been created.

 

Add Module

Module is the "project" that truly contains code in eclipse/visual studio. File-> New Module adds a Module.

Select the Maven module. For more information, see "next". That is, create an empty maven project without using any archetype.

Next, enter the maven coordinate 3 elements (GroupId, ArtifactId, Version) and continue Next

Next, enter the Module name. I personally think it should be improved here. The best Module name is the ArtifactId you just entered by default, which can reduce user input and click Finish.

You can see that the folder structure is displayed in the Project directory tree on the left. Double-click pom. open xml, and add a junit dependency. intelliJ IDEA provides a powerful smart reminder function that intelligently perceives the version number of the dependency.

Note: If you want to add Junit dependencies, add <scope> test </scope>, that is:

Try writing a few classes at will

 

Operation and debugging

See. Note that there is a downward triangle in the upper left corner. For example, click it and select "Edit events ..."

Click the + sign in the upper right corner to add a maven configuration.

The following interface is very similar to eclipse. Add the command line executed by maven, refer to it, and enter the "friendly" name in the name column.

Of course, you can add multiple configurations. For example, HelloApp (compile) indicates compilation, and HelloApp (test) indicates testing. After saving the configuration, return to the idea main interface and find that there is something in the drop-down box.

The triangle button on the right of the drop-down box indicates Run, while the "glowing sun" button on the right of the triangle indicates Debug and click them, you can "run" or "debug"

In addition to executing mvn clean test through configuration, a dedicated junit configuration can also be provided for unit tests. You can add the Junit configuration when you click + Add configuration, this is a simple method, for example, to open a class file with @ Test, then, place the cursor on the method to be tested, such as testAdd, and press it directly to enable the IDE to automatically generate the junit configuration for us and run the configuration immediately.

 

Add a Web module

Still Add the Module in the following interface. IDEA comes with some Archetype by default, but the number is limited. For example, none of the Archetype provided by jboss

Select Create from archetype, and click Add Archetype to manually Add a sample webapp archetype for jboss.

Click OK and select it.

Enter the coordinates of the maven project.

In the following interface, set the maven path (generally automatically identified, without requiring personality), and next

Enter the module name and click Finish.

Click Finish. In the following interface, a major error will be found, indicating that IDEA did not identify the JDK we just set (I don't know if it is an IDEA bug)

Right-click the model "jsf-web-sample" and choose "Open Module Setting". Open the module Settings and select the JDK version in the Module SDK.

After you click OK, the error is eliminated. However, idea does not automatically create the maven directory structure. Therefore, we recommend that you delete the module and try again, note that you must manually select the module sdk and click finish!

Normally, idea will automatically help us create the directory results and some test files.

Next, let's take a look at how to deploy it on jboss, and then click Edit Configurations... here

Click "+" to add the configuration, but this time select "Jboss ".

On the server tab page, enter the Name and the address of the browser to be opened after the deployment is successful.

On the Deployment tab, click the plus sign (+) to add the Artifact to be deployed.

Click OK and return to the idea main interface. You will find that this configuration already exists in the Application Server panel.

There is a small vertical icon button on the left. The first one is start. Click it to enable jboss and deploy the jsf-web-sample application, it can be opened directly in the browser.

Of course, idea has far more functions than that. After getting started, let's take a look.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.