Can't read AppletViewer properties file - Applet
Asked Answered
T

10

30

I created a Java applet program and compiled it. As a result of the compilation, it generated a class file. But, it showed the following warning message while running the applet with the command prompt using the appletviewer command.

D:\Applets\Applets>appletviewer FirstApplet.java

Warning: Can't read AppletViewer properties file: C:eswaran_s.VMSPL\.hotjava\properties Using defaults.

When I run this command once again, it does not show the warning message, but the applet is not running.

How can I solve this issue?

Trolley answered 18/4, 2011 at 12:45 Comment(3)
You should give an HTML file to your applet viewer, not the Java source code.Kaila
I had the same prob even when I pass the .html file to appletviewer. Did you find any solution?Caravel
@PaŭloEbermann: I sometimes use the tag-in-source approach, shown here and here, with -debug.Absa
V
9

My solution to this problem was to simply (in Eclipse) go to Run-> Run configurations... and open the JRE card where I set Java SE to a newer installed version. (in my case from SE 6 to SE 7)

Varicelloid answered 27/11, 2012 at 2:3 Comment(1)
I simply did what you said. Instead of changing version just Applied again and that resolved problem.Divulgence
M
2

The file .appletviewer should be in your home folder. If it's not exist then default file is created. You can also place it in the %USERPROFILE%\.hotjava\properties.

If you run appletviewer it runs because you got any message from it. Suppose your instance is created on the %PATH%. But to run properly you should supply the argument text file that contains deprecated <APPLET> tag. It doesn't matter what extension it has.

Mitchum answered 6/8, 2012 at 18:41 Comment(0)
I
1

Your extension is wrong. You should pass HTML file path like this:

D:\Applets\Applets>appletviewer htmlfile_name.html 

Instead of this:

D:\Applets\Applets>appletviewer FirstApplet.java 
Inconsiderate answered 21/11, 2016 at 12:33 Comment(0)
E
0

It is often very difficult to write, compile and run applets in the applet viewer from the command prompt. A better way would be to download the program Eclipse from the Internet. I often got lots of errors when trying to run programs from the command prompt, and Eclipse automaticly compiles, emphasises special words (like new, break, byte, short etc.) and even error checks your code (it underlines errors with a squiggly red line like Microsoft word's spellcheck). All my problems have been solved! I seriously recommend downloading it.

Eelgrass answered 27/6, 2012 at 12:36 Comment(0)
W
0

i think your jdk miss some package or loss path so re-installed jdk latest version and run your program. and check your htm program is correct or not may be some time occurred due to wrong htm program.

Wag answered 31/10, 2012 at 12:14 Comment(0)
A
0

I had the same problem following the instructions for a similar tutorial from Oracle's Java: A Beginner's Guide - Sixth Edition (pg 515). The directions tell you to immediately run the .java file with the applet viewer. However, you must first compile it. So, C:>javac FirstApplet.java. This will compile the program and create your FirstApplet class file, which is what is currently missing from your execution. Then, C:>appletviewer FirstApplet.java. Your applet should run fine. Seems odd that the tutorial would leave out this instruction.

Astatine answered 2/4, 2015 at 15:57 Comment(0)
L
0

Shoutout to RAB teaching broken code (Applets have been deprecated in most browsers)

Laureate answered 3/1, 2018 at 19:23 Comment(0)
M
0

First, make sure you have the javadoc folder (simply labelled "doc" once extracted) inside your jdk folder as advised here:

http://www.jcreator.com/installation.htm

You can download the doc file from here for Java SE 8:

http://www.oracle.com/technetwork/java/javase/documentation/jdk8-doc-downloads-2133158.html

Make sure you build the project first before running it (Menu/Build/Build Project).

Now run your project.

Mob answered 7/8, 2018 at 1:45 Comment(0)
S
0

if you are using command line to run the file, use this particular line after importing packages.

/*<applet code = "Class_name.class" width=300 height=250></applet>*/
Stockish answered 21/12, 2021 at 17:33 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Fideism
G
-1

I have change this line in the prompt and ready:

D:\Applets\Applets>appletviewer FirstApplet.java 
Gabrielgabriela answered 25/3, 2019 at 2:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.