Netbean 8.0.2 tương thích với java jdk bao nhiêu

NetBeans [@ //netbeans.org] is an open-source Integrated Development Environment [IDE]. NetBeans began in 1996 as a Java IDE student project at Charles University in Prague. Sun Microsystems acquired NetBeans in 1999. In 2010, Oracle acquired Sun [and thus NetBeans].

Compared with its rival Eclipse [//www.elicpse.org] [both are open-source, so I don't know what are they competing for?], NetBeans provides seamless support for Java AWT/Swing, Java ME mobility pack, Java EE, and bundled with an excellent profiler for performance tuning.

NOTE [2018 Feb 01]: NetBeans 8.2 might not work with JDK 9 at this moment. Stick to JDK 8 now, if you want to use NetBeans.

How to Install NetBeans 8.2

How to Install NetBeans on Windows

Step 0: Install JDK

To use NetBeans for Java programming, you need to first install Java Development Kit [JDK]. See "JDK - How to Install".

Step 1: Download

Download "NetBeans IDE" installer from //netbeans.org/downloads/index.html. There are many "bundles" available. For beginners, choose the 1st entry "Java SE" [e.g., "

$ cd netbeans-bin-directory $ ./netbeans

4" 95MB].

Step 2: Run the Installer

Run the downloaded installer.

How to Install NetBeans on Mac OS X

To use NetBeans for Java programming, you need to first install JDK. Read "".

To install NetBeans:

  1. Download NetBeans from //netbeans.org/downloads/. Set "Platform" to "Mac OS X". There are many "bundles" available. For beginners, choose "Java SE" [e.g., " $ cd netbeans-bin-directory $ ./netbeans 5" 116MB].
  2. Double-click the download Disk Image [DMG] file.
  3. Double-click the " $ cd netbeans-bin-directory $ ./netbeans 6", and follow the instructions to install NetBeans. NetBeans will be installed under " $ cd netbeans-bin-directory $ ./netbeans 7".
  4. Eject the Disk Image [" $ cd netbeans-bin-directory $ ./netbeans 8"].

You can launch NetBeans from the "Applications".

Notes: To uninstall NetBeans, drag the "

$ cd netbeans-bin-directory $ ./netbeans

7" folder to trash.

How to Install NetBeans on Ubuntu Linux

To use NetBeans for Java programming, you need to first install JDK. Read "".

To install NetBeans:

  1. Download NetBeans from //netbeans.org/downloads/. Choose platform "Linux [x86/x64]" ⇒ "Java SE". You shall receive a public class Hello {
    public static void main[String[] args] {  
        System.out.println["Hello, world"];  
    }  
    
    } 0 file [e.g., " public class Hello {
    public static void main[String[] args] {  
        System.out.println["Hello, world"];  
    }  
    
    } 1"] in " public class Hello {
    public static void main[String[] args] {  
        System.out.println["Hello, world"];  
    }  
    
    } 2".
  2. Set the downloaded public class Hello {
    public static void main[String[] args] {  
        System.out.println["Hello, world"];  
    }  
    
    } 0 file to executable and run the public class Hello {
    public static void main[String[] args] {  
        System.out.println["Hello, world"];  
    }  
    
    } 0 file. Open a Terminal: $ cd ~/Downloads $ chmod a+x netbeans-7.x-ml-javase-linux.sh $ ./netbeans-7.x-ml-javase-linux.sh Follow the instructions to install NetBeans.

To start NetBeans, run the script "

public class Hello {

public static void main[String[] args] {  
    System.out.println["Hello, world"];  
}  
}

5" in the NetBeans'

public class Hello {

public static void main[String[] args] {  
    System.out.println["Hello, world"];  
}  
}

6 directory:

$ cd netbeans-bin-directory $ ./netbeans

Writing a Hello-world Java Program in NetBeans

Step 0: Launch NetBeans

Launch NetBeans. If the "Start Page" appears, close it by clicking the "cross" button next to the "Start Page" title.

Step 1: Create a New Project

For each Java application, you need to create a "project" to keep all the source files, classes and relevant resources.

  1. From "File" menu ⇒ Choose "New Project...".
  2. The "Choose Project" diglog pops up ⇒ Under "Categories", choose "Java" ⇒ Under "Projects", choose "Java Application" ⇒ "Next".
  3. The "Name and Location" dialog pops up ⇒ Under "Project Name", enter " public class Hello {
    public static void main[String[] args] {  
        System.out.println["Hello, world"];  
    }  
    
    } 7" ⇒ In "Project Location", select a suitable directory to save your works ⇒ Uncheck "Use Dedicated Folder for Storing Libraries" ⇒ Uncheck "Create Main class" ⇒ Finish.
Step 2: Write a Hello-world Java Program
  1. Right-click on " public class Hello {
    public static void main[String[] args] {  
        System.out.println["Hello, world"];  
    }  
    
    } 7" ⇒ New ⇒ Java Class [OR choose the "File" menu ⇒ "New File..." ⇒ Categories: "Java", File Types: "Java Class" ⇒ "Next"].
  2. The "Name and Location" dialog pops up ⇒ In "Class Name", enter " public class Hello {
    public static void main[String[] args] {  
        System.out.println["Hello, world"];  
    }  
    
    } 9" ⇒ Delete the content in "Package" if it is not empty ⇒ "Finish".
  3. The source file " 1 2 3 4 5 6 7 8 9 10 11 12 13 14 0" appears in the editor panel. Enter the following codes: public class Hello {
    public static void main[String[] args] {  
        System.out.println["Hello, world"];  
    }  
    
    }
Step 3: Compile & Execute

There is no need to "compile" the source code in NetBeans explicitly, as NetBeans performs the so-called incremental compilation [i.e., the source statement is compiled as and when it is entered].

To run the program, right-click anywhere in the source [or from the "Run" menu] ⇒ Run File. Observe the output on the output console.

Notes:

  • You should create a NEW Java project for EACH of your Java application.
  • Nonetheless, NetBeans allows you to keep more than one programs in a project, which is handy for writing toy programs [such as your tutorial exercises]. To run a particular program, open and right-click on the source file ⇒ Run File.

Correcting Syntax Error

NetBeans performs incremented compilation, as and when a source line is entered. It marked a source line with syntax error with a RED CROSS. Point your cursor at the RED CROSS to view the error message.

You CANNOT RUN the program if there is any syntax error [marked by a RED CROSS before the filename]. Correct all the syntax errors; and RUN the program.

[TODO] Diagram

HINTS: In some cases, NetBeans shows a ORANGE LIGHT-BULB [for HINTS] next to the ERROR RED-CROSS [Line 5 in the above diagram]. You can click on the LIGHT-BULB to get a list of HINTS to resolve this particular error, which may or may not work!

SYNTAX WARNING: marked by a orange triangular exclaimation sign. Unlike errors, warnings may or may not cause problems. Try to fix these warnings as well. But you can RUN your program with warnings.

Read the NetBeans Documentation

At a minimum, you SHOULD READ the "IDE Basics, Getting Started, Java Application", which is accessible via NetBeans's "HELP" menu ⇒ Help Contents. This will save you many agonizing hours trying to figure out how to do somethings later.

The "Help" ⇒ "Online Doc and Support" [@ //netbeans.org/kb/index.html] contains many articles and tutorial on using NetBeans.

The NetBeans "Start Page" also provides many useful links to get you started.

Debugging Program in NetBeans

Step 0: Write a Java Program

The following program computes and prints the factorial of

1 2 3 4 5 6 7 8 9 10 11 12 13 14

1 [

1 2 3 4 5 6 7 8 9 10 11 12 13 14

2]. The program, however, has a logical error and produce a wrong answer for

1 2 3 4 5 6 7 8 9 10 11 12 13 14

3

1 2 3 4 5 6 7 8 9 10 11 12 13 14

4 ["

1 2 3 4 5 6 7 8 9 10 11 12 13 14

5" - a negative number?!].

1 2 3 4 5 6 7 8 9 10 11 12 13 14

public class Factorial { public static void main[String[] args] {

  int n = 20;  
  int factorial = 1;  
  for [int i = 1; i 

Chủ Đề