Department of Computational Science
BSIT | BSCS | BSMath
SDF1 / PF1
Program
Environment
Set-up
Jomarie S. Isorena
Installation and Configuration of
Java Development Kit (JDK)
Java Development Kit (JDK)
What is JDK?
Java Development Kit (JDK) is a cross-platformed software development environment that offers
a collection of tools and libraries necessary for developing Java-based software applications and
applets
The Architecture of JDK in Java
Java Development Kit (JDK)
What is JDK?
Java Development Kit (JDK) is a cross-platformed software development environment that offers
a collection of tools and libraries necessary for developing Java-based software applications and
applets
The Architecture of JDK in Java
Java Development Kit (JDK)
Three vital software modules of JDK
• JVM (Java Virtual Machine)
⚬ Java Virtual Machine is a software tool responsible for creating a run-time environment for
the Java source code to run. The very powerful feature of Java, "Write once and run
anywhere," is made possible by JVM.
⚬ The JVM stays right on top of the host operating system and converts the java source
code into ByteCode (machine language), and executes the program.
• JDK (Java Development Kit)
⚬ Java Development Kit as a software development environment responsible for creating a
run-time environment for the Java source code to run.
Java Development Kit (JDK)
Components of JDK in Java
• java
⚬ It acts as the deployment launcher in the older SUN java. It loads the class files and
interprets the source code compiled by the javac compiler.
• javac
⚬ The javac specifies the java compiler to convert the source code into bytecode.
• javadoc
⚬ The javadoc generates documentation for the comments added in the source code.
• jar
⚬ The jar helps the archives to manage the jar files in the package library.
• jps
⚬ The jps stands for Java Virtual Machine Process Status Tool. It manages the active JVMs for
the currently executing program.
• appletviewer
⚬ The appletviewer is designed to run and debug Java applets without the help of an
internet browser.
• idlj
⚬ An IDL-to-Java compiler generates Java bindings from a given Java IDL file.
Java Development Kit (JDK)
Components of JDK in Java
• javap
⚬ The javap acts as a file disassembler.
• JConsole
⚬ JConsole acts as a Java Management and Monitoring unit.
• javah
⚬ The javah is a stub-generator, and C-Header is employed to write native methods.
• javaws
⚬ The javaws acts as the Web Start launcher for JNLP applications.
• jhat
⚬ The jhat is a heap analysis tool.
• jmc
⚬ The jmc stands as an abbreviation for Java Mission Control.
Java Development Kit (JDK)
The Java Language Specification, API, JDK, and IDE
• Computer languages have strict rules of usage. If you do not follow the rules when writing a
program, the computer will not be able to understand it. The Java language specification and
the Java API define the Java standards.
• The Java language specification is a technical definition of the Java programming language’s
syntax and semantics.
• The application program interface (API), also known as library, contains predefined classes
and interfaces for developing Java programs. The API is still expanding.
• Java is a full-fledged and powerful language that can be used in many ways. It comes in
three editions:
⚬ Java Standard Edition (Java SE) to develop client-side applications. The applications can
run standalone or as applets running from a Web browser.
⚬ Java Enterprise Edition (Java EE) to develop server-side applications, such as Java
servlets, JavaServer Pages (JSP), and JavaServer Faces (JSF).
⚬ Java Micro Edition (Java ME) to develop applications for mobile devices, such as cell
phones.
Java Development Kit (JDK)
How to install JDK
Go to the Oracle JDK download page (you can choose the version you need, such as JDK 11 or
17) and download the Windows/MacOS/Linux installer (depends on your installed OS).
• Windows OS
⚬ Run the installer and follow the on-screen instructions.
⚬ Choose the installation directory (the default is usually fine).
⚬ Open the Start Menu and search for Environment Variables, then click on Edit the system
environment variables.
⚬ In the System Properties window, click the Environment Variables... button.
⚬ In the System variables section, click New... and add a new variable:
■ Variable Name: JAVA_HOME
■ Variable Value: The path to the JDK installation directory (e.g., C:\Program Files\Java\
jdk-17).
⚬ Find the Path variable in the System variables section, select it, and click Edit....
⚬ Click New and add %JAVA_HOME%\bin to the list.
⚬ Open Command Prompt and type java -version to check the installed JDK version.
⚬ Type javac -version to ensure that the compiler is also installed.
Java Development Kit (JDK)
How to install JDK
• macOS
⚬ Open the downloaded .dmg file and run the installer package.
⚬ Follow the instructions to complete the installation.
⚬ Open Terminal and use a text editor to open or create the ~/.bash_profile or ~/.zshrc file,
depending on your shell.
⚬ Add the following line
■ export JAVA_HOME=$(/usr/libexec/java_home)
⚬ Save the file and run source ~/.bash_profile or source ~/.zshrc to apply the changes.
⚬ Open Terminal and type java -version to check the installed JDK version.
⚬ Type javac -version to ensure the compiler is also installed.
Java Development Kit (JDK)
How to install JDK
• Linux (Ubuntu/Debian-based distributions)
⚬ Update the Package Index using
■ sudo apt update
⚬ To install OpenJDK (an open-source implementation of the JDK), run
■ sudo apt install openjdk-11-jdk
⚬ For a specific version, replace 11 with the desired version number (e.g., 17)
⚬ If you have multiple Java versions installed, you can set the default version
■ sudo update-alternatives --config java
⚬ Follow the on-screen prompts to select the version you want to use by default.
⚬ Open Terminal and type java -version to check the installed JDK version.
⚬ Type javac -version to ensure the compiler is also installed.
Installation and Configuration of
Integrated Development
Environment (IDE)
Integrated Development Environment (IDE)
What java IDE?
• A Java IDE (for Integrated Development Environment) is a software application which enables
users to more easily write and debug Java programs.
How to Install?
Go to the Apache NetBeans download page and choose the latest release and download the Windows/MacOS/Linux
installer (depends on your installed OS).
• Windows OS
⚬ Run the downloaded installer and follow the installation wizard.
⚬ During the installation, the wizard should automatically detect the installed JDK. If not, manually specify the
path to the JDK.
• macOS
⚬ Open the downloaded .dmg file and drag the NetBeans icon to your Applications folder.
⚬ Open Apache NetBeans from your Applications folder and create a new Java project to ensure everything is
working properly.
• Linux (Ubuntu/Debian-based distributions)
⚬ Open the terminal, navigate to the directory where the installer is located, and make the installer executable
■ chmod +x Apache-NetBeans-*-linux.sh
■ sudo ./Apache-NetBeans-*-linux.sh
⚬ Follow the installation wizard to complete the setup.
⚬ Open Apache NetBeans by typing netbeans in the terminal or using the application launcher. Create a new
Java project to ensure the setup is correct.
References
• What is a Java Development Kit (JDK)? Why Do We Need It, Kartik Menon (2024), SimpliLearn,
https://www.simplilearn.com/tutorials/java-tutorial/jdk-in-java
• Oracle's Official Documentation, https://docs.oracle.com/en/java/javase/
• Java Tutorials by Oracle, https://docs.oracle.com/javase/tutorial/
• Linux JDK Installation Guides, https://help.ubuntu.com/community/Java
• Apache NetBeans Installation Guide, https://netbeans.apache.org/download/index.html ,
https://netbeans.apache.org/kb/docs/ide/install.html
Department of Computational Science
BSIT | BSCS | BSMath
Thank you!