Installing NetBeans Java IDE on Microsoft Corporation's Windows 10 OS
Video intro and tutorial
Step 1: Downloads
Step 2: Environment Variable Configuration
Step 3: Extraction and Install
Step 4: Setup and Testing
The NetBeans IDE allows you to develop Java applications of almost any size--ranging from a simple, single-file program to full-scale enterprise applications consisting of thousands of classes and dependent libraries, and web servers.
Video intro and tutorialmotorcycle
Download, extraction, and placement
NetBeans is not Java, it's a tool for allowing easy interaction with the Java development tools which are installed separately. Why separately? It allows for modularity; since programming is about creating your own tools, folks often want to use different versions of Java, or Java tools written by different parties. By separating Java from NetBeans, you are allowed the freedom of choice for which underlying Java tools you wish to use.
Download Oracle OpenJDK
JDK stands for Java Development Kit and includes both the Java Runtime Environment (JRE) and a set of tools for writing your own Java programs. Your instructor recommends the Oracle corporation's open source JDK:
Extract and move to C:\Program Files\Java
Once you've downloaded the JDK, you'll have a .zip directory on your system, probably in your Downloads directory. Assuming this, follow these steps:
- Open a file browser and navigate to "My Computer" and then your primary hard drive, probably called C:. Then find your Program File directory.
- Create a new directory (i.e. a "Folder") inside Program Files called Java.
- Open a new file browser and navigate to your Downloads directory, locating your .zip file you just downloaded
- Right click and select something like "Extract"
- You'll be prompted for where you want to extract the files. Choose the C:\Program Files\Java directory you just created.
- Tell the system to extract the files
- Verify that when you look inside your Java directory you have another directory that has the words "jdk" in the name along with version numbers
Download NetBeans 12 IDE
NetBeans is free and open source. It comes in many versions, and you can use the latest version: 12, which can be downloaded as a .exe file. Note that your browser will probably warn you that downloaded a straight .exe file can be dangerous. You may be prompted to enter an administrator password. You can trust the NetBeans folks, but you should heed such warnings and think carefully when downloaded an executable file from an untrusted source, like some random website.
This will also probably download by default to your Downloads directory (i.e. "Folder") which is fine, since the executable file will install to its own new directories without your help--just your approval.motorcycle
Step 2: Environment variable configuration
An environment variable is a named value that is accessible to any program and provided by your operating system. We will create a variable called JAVA_HOME and inject the location of your JDK extraction so the NetBeans installer can wire itself up to your Java tools.
Since this is a common task, I'll just link to an existing on mykong tutorial on how to do this.
Don't be a lemming and just do exactly as it says: make sure the file path you set for JAVA_HOME is actually the directory you created in the previous step!motorcycle
Step 3: Install
With the JDK extracted, NetBeans downloaded, and your environment variable setup, locate the .exe file for the NetBeans installation. Double click it in a file browser, give administrative approval, and walk through the install steps carefully. The default locations for the install will work for most folks.motorcycle
Step 4: Setup and testing
If All goes well, NetBeans installer will say "Success!" and you can now find a program called NetBeans in your start menu. Fire it up and see the glory!
You'll want to make a container for your programs, which NetBeans calls a Project. Do this by navigating:
- File >> New Project
- If you have the option of a Maven project, don't choose this. The Ant (Not "alice" as I had previously posted) build system, which is simpler than Maven, is your desired choice. On the right, select "Java Application"
- Name the project something like "cit111online". NetBeans will protect you from yourself and not allow spaces or weird characters. You can keep "create main class" selected for this test. See below.
- Then in the project browser, expand "Source Packages"
- You'll probably find a default created package with a corresponding class in it with the same name as the project, except for a leading Capital letter.
- Add a simple print statement as shown, and then navigate to run >> run file or press shift and F6. Your output should show your printed statement! If so, you're in luck! If not, look for error messages and type them into google with the words "windows 10" after it and see what help you can find
- If all fails, come to an office hours via Zoom and get instructor help.
Page created on 9-SEP-2020 and can be freely reproduced according to the site's content use agreement.