Table of Contents
3 How to install NetBeans
Home Java javaTutorial Getting started with Java 9

Getting started with Java 9

Jun 23, 2017 pm 04:30 PM
java introduce getting Started Reveal

Text by / Lin Bentuo

Java 9

##In the first part, the main content is explained as follows:

  • JDK 9 includes What content

  • System requirements for running the code

  • How to install NetBeans

1 JDK Introduction

JDK 9 is the ninth major version of the Java Development Kit, scheduled for release in late July 2017. It brings many exciting new features. This set of tutorials mainly introduces useful functions for Java developers in daily programming. You can find a complete list of all features on .

One of the most important and exciting features of JDK 9 is the module system, developed under a project with the code name Jigsaw. JDK designers have been working to bring a module system to the Java platform for more than 10 years. It was planned to be part of several previous JDK versions and was later removed. The Jigsaw project has also delayed the release of the JDK 9 version many times. However, Jigsaw is taking active action recently and releasing a new JDK version.

Tips

Jigsaw is a sub-project under the OpenJDK project. It aims to design and implement a standard module system for the Java SE platform and apply it to the platform and JDK.

What difficulties did the Jigsaw project encounter that took so many years to complete? The main goal of Jigsaw is to provide Java developers with a way to develop applications using software components called modules. A module can export its API for public use and encapsulate its internals. Modules can also declare dependencies on other modules, and these dependencies can be verified at startup to avoid missing type errors at runtime. The JDK itself is divided into a series of modules that interact with each other. This provides a scalable runtime. If your application uses a subset of the JDK, you can create a runtime image that contains the JDK modules used in your application and application modules. All these features of the module system look normal. The main issue that has always troubled JDK designers is backward compatibility and migration of the module system. Java has been around for over 20 years. Any significant features, including the module system, must be easily applicable. Based on feedback from the Java community, it went through several iterations of redesign and improvement, and finally got to where it is now.

Another important addition to JDK 9 is JShell, Java’s interactive programming environment. JShell is a command line tool and API that allows executing a piece of code and getting instant feedback. Before JShell, you had to write a complete program, compile it and run it to get the results. JShell is a tool you use in your daily development. JShell is essential for beginners to help them learn the Java language quickly without knowing the details of program structure such as modules and packages.

In addition, JDK 9 also adds some other new features to make your development easier. For example, Reactive Streams API, collection factory methods, planned HTTP/2 Client API, Stack-Walking API, Platform Logging API and unified JVM logging.

2 System requirements for running the code

First, you need to download

JDK 9 (Java Development Kit 9). You need to download it from this website JDK9. If you can't access it, you can use Download.

First you need to agree to the license agreement, and then you can download it. Java 9 can run on many platforms:

  • Windows 32-bit

  • Windows 64-bit

  • macOS 64-bit (formerly known as Mac OS X * or simply OS X)

  • Linux 32-bit

  • Linux 64 -bit

  • Linux on ARM 32-bit

  • ##Linux on ARM 64-bit
  • The next step is to configure
environment variables

. The same as the previous JDK configuration method. Here, I take macOS 10.12 version as an example, the configuration on Macbook. Here you will need some basic operations of vi, you can go online to find how to use it. After downloading the JDK, run it directly. Then the installation directory is: /library/Java/JavaVirtualMachines/jdk-9.jdk/
Under Terminal, enter the current directory of your user (it is your user’s default directory when you open it, I really don’t know Type cd

on the command line to switch to the default directory). Execute the

ls -a
command on the command line to list files or directories including hidden files in the current directory.

ls -a4. Find the .bash_profile file. This file will affect your current user's configuration information, and execute the

vi .bash_profile

command to edit this file.
vi .bash_profile5. After entering the edit page, configure the Java Home and Path environment variables:

Configure Java environment variables

6. After configuring, use the esc key to exit the editing state, enter ":wq", save and exit. And execute . .bash_profile to make the configuration file take effect immediately. Execute javac -version on the command line. If the following information is output, it means the JDK configuration is correct.

javac 9-ea

At this point, the JDK configuration is complete.

3 How to install NetBeans

If you want to compile and run Java programs, you need to install an integrated development environment (IDE) on your computer, such as NetBeans or Eclipse. No IDE currently fully supports the module system in JDK 9. However, NetBeans supports the creation of one module per NetBeans project. That is, if you want to create three Java modules in NetBeans, you need to create three NetBeans Java projects. A Java module can reference other Java modules using project dependencies in NetBeans. Currently, NetBeans does not support multi-module Java projects. The latest information about module system support in NetBeans can be found on the wiki page: .

You can download the latest NetBeans version that supports JDK 9 from the following link:. There are many NetBeans versions for us to download. For convenience, we download the "All" version directly.

下载 NetBeans

At this point, the configuration of JDK 9 has been completed and NetBeans has been downloaded. The detailed configuration of NetBeans will be introduced in subsequent chapters.

The above is the detailed content of Getting started with Java 9. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Break or return from Java 8 stream forEach? Break or return from Java 8 stream forEach? Feb 07, 2025 pm 12:09 PM

Java 8 introduces the Stream API, providing a powerful and expressive way to process data collections. However, a common question when using Stream is: How to break or return from a forEach operation? Traditional loops allow for early interruption or return, but Stream's forEach method does not directly support this method. This article will explain the reasons and explore alternative methods for implementing premature termination in Stream processing systems. Further reading: Java Stream API improvements Understand Stream forEach The forEach method is a terminal operation that performs one operation on each element in the Stream. Its design intention is

PHP: A Key Language for Web Development PHP: A Key Language for Web Development Apr 13, 2025 am 12:08 AM

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

PHP vs. Python: Understanding the Differences PHP vs. Python: Understanding the Differences Apr 11, 2025 am 12:15 AM

PHP and Python each have their own advantages, and the choice should be based on project requirements. 1.PHP is suitable for web development, with simple syntax and high execution efficiency. 2. Python is suitable for data science and machine learning, with concise syntax and rich libraries.

PHP vs. Other Languages: A Comparison PHP vs. Other Languages: A Comparison Apr 13, 2025 am 12:19 AM

PHP is suitable for web development, especially in rapid development and processing dynamic content, but is not good at data science and enterprise-level applications. Compared with Python, PHP has more advantages in web development, but is not as good as Python in the field of data science; compared with Java, PHP performs worse in enterprise-level applications, but is more flexible in web development; compared with JavaScript, PHP is more concise in back-end development, but is not as good as JavaScript in front-end development.

Java Program to Find the Volume of Capsule Java Program to Find the Volume of Capsule Feb 07, 2025 am 11:37 AM

Capsules are three-dimensional geometric figures, composed of a cylinder and a hemisphere at both ends. The volume of the capsule can be calculated by adding the volume of the cylinder and the volume of the hemisphere at both ends. This tutorial will discuss how to calculate the volume of a given capsule in Java using different methods. Capsule volume formula The formula for capsule volume is as follows: Capsule volume = Cylindrical volume Volume Two hemisphere volume in, r: The radius of the hemisphere. h: The height of the cylinder (excluding the hemisphere). Example 1 enter Radius = 5 units Height = 10 units Output Volume = 1570.8 cubic units explain Calculate volume using formula: Volume = π × r2 × h (4

PHP vs. Python: Core Features and Functionality PHP vs. Python: Core Features and Functionality Apr 13, 2025 am 12:16 AM

PHP and Python each have their own advantages and are suitable for different scenarios. 1.PHP is suitable for web development and provides built-in web servers and rich function libraries. 2. Python is suitable for data science and machine learning, with concise syntax and a powerful standard library. When choosing, it should be decided based on project requirements.

Create the Future: Java Programming for Absolute Beginners Create the Future: Java Programming for Absolute Beginners Oct 13, 2024 pm 01:32 PM

Java is a popular programming language that can be learned by both beginners and experienced developers. This tutorial starts with basic concepts and progresses through advanced topics. After installing the Java Development Kit, you can practice programming by creating a simple "Hello, World!" program. After you understand the code, use the command prompt to compile and run the program, and "Hello, World!" will be output on the console. Learning Java starts your programming journey, and as your mastery deepens, you can create more complex applications.

PHP: The Foundation of Many Websites PHP: The Foundation of Many Websites Apr 13, 2025 am 12:07 AM

The reasons why PHP is the preferred technology stack for many websites include its ease of use, strong community support, and widespread use. 1) Easy to learn and use, suitable for beginners. 2) Have a huge developer community and rich resources. 3) Widely used in WordPress, Drupal and other platforms. 4) Integrate tightly with web servers to simplify development deployment.

See all articles