Skip to content
Related Articles

Related Articles

How to Install Java Applet Viewer on Linux?

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 17 Dec, 2021

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 process of installing a Java Applet Viewer on Linux.

Installing Java Applet Viewer on Linux:

Follow the below steps to install Java Applet Viewer on Linux:

Step 1: For installing Java Applet Viewer, you need to first download Java JDK 8. Because Java gives applet only up to JDK version 9 only.

Step 2: Open Terminal and execute the below command:

 sudo apt install openjdk-8-jdk openjdk-8-jre 

This command will install Java JDK 8. Or if you already installed it, it will give the following output.

Installing Java Applet Viewer on Linux

Step 3: Write a sample applet code. You can write the following code also. Save it by the name in a folder which name is also Java.


import java.awt.*;
import java.applet.*;
public class Demo extents Applet
  public void init()
  public void paint(Graphics g)
    g.drawString("Welcome To Java Applet",40,50);

Step 4: Write the following commands one by one to execute the applet program.

cd Java/

change directory to the .java file

Step 5: As a result, the program will be executed & give output.

Hence Java Applet Viewer is successfully installed.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!