How to Install Java Applet Viewer in Windows?
Last Updated :
08 Jul, 2024
Applet Viewer is a command-line program to run Java applets. It is included in the SDK. It helps you to test an applet before you run it in a browser. An applet is a special type of application that's included as a part of an HTML page and can be stored in a web page and run within a web browser. The applet's code gets transferred to the system, and then the browser's Java Virtual Machine (JVM) executes that code and displays the output.
In this article, we will learn how to set up and use Java Applet Viewer on Windows.
Note: The appletviewer
tool was removed from JDK 9 and onwards, you'll need to use JDK 8 to run applets.
Common features:
- Smaller, incremental JRE download and faster applet startup.
- Applets run in a separate process to the browser, and each applet can optionally run in a separate JVM instance, so one misbehaving applet cannot affect other applets or the browser.
- Applets can have parameters passed to them to control behavior such as setting a large initial heap size to avoid out-of-memory exceptions.
- Applets can now be dragged out of the web browser and run as separate applications.
Steps to Install Java Applet Viewer in Windows
Now let us discuss steps that are been involved sequentially with the help of visual aids to install java applet viewer in Java. Below we are providing steps right from scratch as follows:
Step 1: Download JDK 8
Search and download the JDK 8. Below we are downloading version 8.

Click on the link in the browser provided by oracle docs.
Note: We do have Open JDK and ORacle JDK, as far as development in java is concerned we have to always go with Oracle JDK>

Scroll down the page & find the windows x64 download link

Accept and download the file.

Step 2: Install JDK 8
Install it by clicking next every time and at last click on finish, just like installing any other application for windows.
In the below image, we can see the JDK 8 has installed successfully in our system.
Step 3: Set Up Environment Variables
1. Set JAVA_HOME
:
- Right-click on
This PC
or My Computer
on your desktop or in File Explorer. - Click on
Properties
. - Click on
Advanced system settings
. - Click on
Environment Variables
. - Under
System variables
, click New
and set Variable name
to JAVA_HOME
and Variable value
to the path where JDK 8 is installed.
Path where JDK 8 is installed:
2. Update PATH
Variable:
- In the
System variables
section, find the Path
variable and click Edit
. - Add a new entry with the path to the
bin
directory of your JDK 8 installation.
3. Verify Installation:
- Open Command Prompt window.
- Type
java -version
and javac -version
to ensure it shows the JDK 8 version.
After this, write appletviewer command to check whether it is there or not,
Step 4: Prepare the Java Applet
- Create a Project Directory: Create a directory for the project. For example,
C:\JavaApplets
. - Create Applet Java Source File: Inside the project directory, create a file named SampleApplet.
java
:
SimpleApplet.java:
Java
import java.applet.Applet;
import java.awt.Graphics;
public class SimpleAppletApplet extends Applet {
@Override
public void paint(Graphics g) {
g.drawString("Hello, World!", 20, 20);
}
}
Step 5: Compile the Java Applet
- Open Command Prompt:
- Open Command Prompt window.
- Navigate to the directory where the applet source file is located:
- Compile the Applet:
- Use the
javac
command to compile your applet:
Step 5: Create an HTML File to Reference the Applet
- Create an HTML File: In the same directory where our applet class file (Simple
Applet.class
) is located, create a file named SimpleApplet.html
:
HTML
<html>
<body>
<applet code="SimpleApplet.class" width="300" height="300">
</applet>
</body>
</html>
Below is the SimpleApplet.html file location:
Step 6: Run Your Java Applet
- Navigate to the Project Directory: In the Command Prompt window, navigate to the directory where your applet and HTML file are located.
- Run the Applet Using
appletviewer
: Use the appletviewer
tool to run the applet:
appletviewer SimpleApplet.html
By following these steps, we can set up and run Java applets using the appletviewer
tool on Windows with JDK 8.
Similar Reads
How to Install Java Applet Viewer in MacOS? An applet is a small Java program that is intended to be run within a web page. Applets are often used to provide interactive features on websites, such as games or graphical tools. They are embedded in HTML pages and are run within a Java-enabled web browser, or within a Java Applet Viewer. Applets
3 min read
How to Install Java Applet Viewer on Linux? Applet viewer is a command-line program to run a java applet. It helps you to test an applet before you run it in the browser. The applet's code gets transferred to the system & then the Java Virtual Machine (JVM) of the browser & executes that code. In this article, we will look into the pr
2 min read
How to Install NetBeans Java IDE on Windows? NetBeans IDE is a Free open-Source, Cross-plate form Integrated Development Environment (IDE) with built-in support for the JAVA Programming Language. It can run any machine which consists of the Java Virtual Machine (JVM). It consists of many features for application development as follows: Drag
2 min read
How to Install WebStorm on Windows? WebStorm is a cross-platform integrated development environment (IDE) and is used for developing web applications in React, Vue, Angular, Express, Php, Meteor, Ruby, etc. It has been maintained by Jetbrains since its launch and is primarily written in Java. As one of the most popular JavaScript IDEs
2 min read
How to Install Apache Tomcat on Windows? Apache Tomcat which is short for âTomcatâ is a free, open-source Java Servlet, Java Expression Language, JavaServer Pages, and WebSocket implementation. Tomcat is an HTTP web server that basically runs Java code in a âpure Javaâ environment. Here, we will see how to install Tomcat 10 on Windows 10 f
3 min read
How to Install Multiple JDKâs in Windows? The 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. It is a core package used in Java, along with the JVM (Java Virtual Machine) and the JRE (Java
6 min read