-2

i installed java jdk on my RHEL 8 system. But I cannot see it in my browser. When I test browser for java it says Java is not installed.

# dnf install java-1.8.0-openjdk.x86_64

# java -version
openjdk version "1.8.0_442"
OpenJDK Runtime Environment (build 1.8.0_442-b06)
OpenJDK 64-Bit Server VM (build 25.442-b06, mixed mode)

There is no java.conf file on system.

I have put following in my .bashrc as asked in net elsewhere:

$ readlink -f $(which java)
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.442.b06-2.el8.x86_64/jre/bin/java

$ printenv|grep -i java
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.442.b06-2.el8.x86_64/jre

$ echo $PATH
/home/user1/.local/bin:/home/user1/bin:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.442.b06-2.el8.x86_64/jre/bin:/home/user1/.local/bin:/home/user1/bin:/usr/share/Modules/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
$ firefox&
[1] 2475911

enter image description here

1
  • 2
    Applets are deprecated and IMO even when supported in older browsers of the day they were pretty unreliable. Time to find yourself different technology. Commented May 31 at 15:11

2 Answers 2

3

Java in browsers is not a thing since last decade. It was removed since Java 9. See the reasons in Why were applets deprecated in JDK 9?

If you see Java in a browser today you are exposed to a security risk. Fortunately modern browsers and Java/JDK versions do not support that anymore.

Sign up to request clarification or add additional context in comments.

3 Comments

thx for the comment. I have now installed jdk 1.8 as i have to run some java applets in browser. But it still wont work...
Then the conditions have changed from the original question that used JDK 21.
Also note that I mentioned that modern browsers removed support for Java, even if the Java version does support it. You didn't mention the brand and version of your browser. I believe that RHEL 8 uses Firefox by default. Firefox removed support for Java in version 51. The current version at this time is 139.
3

According to this page:

Firefox no longer provides NPAPI support (technology required for Java applets)

As of September, 2018, Firefox no longer offers a version which supports NPAPI, the technology required to run Java applets. The Java Plugin for web browsers relies on the cross-platform plugin architecture NPAPI, which had been supported by all major web browsers for over a decade. The 64 bit version of Firefox has never supported NPAPI, and Firefox version 52ESR is the last release to support the technology. It is below the security baseline, and no longer supported.

So if you wanted Java support in Firefox in RHEL 8 you would have to locate, download and install a 32-bit version of Firefox 52ESR (or older) and a 32-bit version of Java 8. And even then, there is no guarantee that it will work.

AFAIK, all modern alternative browsers have similar problems. (And you can't run Internet Explorer natively on a Linux box, even if you were crazy enough to want to.)

My advice would be to drop this idea. Java applets are dead technology.

Alternatives:

  • If it is your code, consider rewriting it as a Swing or JavaFX application or as a Flutter web app or an HTML 5 native application or something.
  • You might be able to get an applet to work using the CheerpJ Applet Runner.
  • You might be able to get it to run from a command prompt using the Java 8 appletviewer tool.
  • You might be able to get it to launch from a browser using Java Web Start (deprecated), or its successor OpenWebStart.

3 Comments

Thank you for all these details. This certainly gives me path to explore. I have to get this working So my first stop will be getting 'working' versions for java and firefox. By the way I tried on all 3: ff, chrome, edge... nothing worked so far.
"By the way I tried on all 3: ff, chrome, edge... nothing worked so far." - Yup. None of them will work out of the box. All modern browsers have dropped support for the (old) Java plugin.
And as I said: "My advice would be to drop this idea. Java applets are dead technology." Try one of the alternatives, or drop the idea entirely.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.