0

I have written a program appletExample.java.

c:/users/set path = "C:\Program Files\Java\jdk-16\bin"
c:/users/desktop/jp>appletviewer appletexample.java

The error is"

'applet viewer' is not recognized as an internal or external command,
    operable program or batch file.

I am getting this error. But set path is also correct way but why this error has occurred? Could anyone explain to me?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
CR28
  • 31
  • 6

2 Answers2

1

I think jdk 16 has eliminated applets so one who would like to run applets download jdk 8 version.

As jdk 15 also doesn't have applets if you want to check your version support appletviewer or not do this thing: Go to windows> program files >java > jdk 1.5.05 > bin

So in that folder if you find appletviewer.exe then your version supports applets.

If you don't find that thing then you must go and download jdk 8 version or others which support applets.

CR28
  • 31
  • 6
0

As other people have said, applets are history really but try the following:

(cd to wherever appletexample.java is)
set PATH="C:\Program Files\Java\jdk-16\bin";%PATH%
appletviewer appletexample.java

Bear in mind that to run a java file as an argument to appletviewer, it needs to have a special format with commented-out applet tags in the Java source

g00se
  • 3,207
  • 2
  • 5
  • 9
  • I think jdk 16 doesn't have applets or appletviewer – CR28 Jul 20 '21 at 06:56
  • I think jdk 16 has eliminated applets so one who would like to run applets download jdk 8 version. – CR28 Jul 20 '21 at 06:58
  • Ah yes, you could be right. I have 16 installed but I see appletviewer points to a version 8 JDK and my 16 has no appletviewer. Applets are a dead end – g00se Jul 20 '21 at 09:55