It includes the Java Runtime Environment (JRE), an interpreter/loader (java), a compiler (javac), an archiver (jar), a documentation generator (javadoc) and other tools needed in Java development. Download the Mac OS X x64.dmg files version Java 7; Java 8. Creating, Running and Packaging Your First Java Application This tutorial illustrates a Java SE application development workflow. The age-old application is used as an example. • • • • • • • • • • • • • • • Creating a project Any new development in IntelliJ IDEA starts with creating a. So let's create one now. • If no project is currently open in IntelliJ IDEA, click Create New Project on the Welcome screen. Otherwise, select File| New| Project. As a result, the New Project wizard opens. • In the left-hand pane, select Java. (We want a Java-enabled project to be created, or, to be more exact, a project with a Java module.) • Specify the that you want to use in your project (the Project SDK field). Do one of the following: • Select the JDK from the list. • If the desired JDK is already available on your computer but is missing from the list, click New and, in the dialog that opens, select the JDK installation directory. Microsoft office excel 2011 free download for mac. • Click Download JDK. Because our application is going to be a 'plain old Java application', we don't need any additional technologies to be supported. So, don't select any of the options under Additional Libraries and Frameworks. • The options on the next page have to do with creating a Java class with a main() method. Since we are going to study the very basics of IntelliJ IDEA, and do everything from scratch, we don't need these options at the moment. So, don't select any of the options. • On the next page, specify the project name (e.g. If necessary, change the project location suggested by IntelliJ IDEA. Click Finish. Wait while IntelliJ IDEA is creating the project. When this process is complete, the structure of your new project is shown in the Project tool window. Exploring the project structure Let's take a quick look at the project structure. ![]() There are two top-level nodes: • HelloWorld. This node represents your Java module. The.idea folder and the file HelloWorld.iml are used to store configuration data for your project and module respectively. The folder src is for your source code. • External Libraries. This is a category that represents all the 'external' resources necessary for your development work. Currently in this category are the.jar files that make up your JDK. (For more information, see and.) Creating a package and a class Now we are going to create a package and a class. Let the package and the class names be com.example.helloworld and HelloWorld respectively. Though a package can be created separately, we will create both the package and the class at once. • In the Project tool window, select the src folder and press Alt+Insert. (Alternatively, you can select File| New, or New from the context menu for the folder src.) • In the New menu, select Java Class (e.g. By pressing Enter). • In the Create New Class dialog that opens, type com.example.helloworld.HelloWorld in the Name field. The Class option selected in the Kind list is OK for creating a class. Press Enter to create the package and the class, and close the dialog. The package com.example.helloworld and the class HelloWorld are shown in the Project tool window. At the same time, the file HelloWorld.java (corresponding to the class) opens in the editor. Note the package statement at the beginning of the file and also the class declaration. When creating the class, IntelliJ IDEA used a file template for a Java class. (IntelliJ IDEA provides a number of predefined file templates for creating various file types. For more information, see.) Also note a yellow light bulb. This bulb indicates that IntelliJ IDEA has suggestions for the current context. Click the light bulb, or press Alt+Enter to see the suggestion list. At the moment, we are not going to perform any of the actions suggested by IntelliJ IDEA (such actions are called.) Note, however, that this IntelliJ IDEA feature may sometimes be very useful. Finally, there are code folding markers next to the commented code fragment. Click one of them to collapse that fragment. (For more information, see.) Writing code for the HelloWorld class The code in its final state (as you probably know) will look this way. Println ( 'Hello, World!' ); We'll do that using code auto-completion. Type Sy The code completion suggestion list is shown. Select System (java.lang) by pressing Enter. Type.o and press Ctrl+. Out is inserted followed by a dot.
0 Comments
Leave a Reply. |