File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes I/O exception while reading: C:\-classpath..? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "I/O exception while reading: C:\-classpath..?" Watch "I/O exception while reading: C:\-classpath..?" New topic

I/O exception while reading: C:\-classpath..?

darine darine
Ranch Hand

Joined: Mar 08, 2001
Posts: 43
hi all
I'm trying to use appletviewer to run my applet and i'm getting that exception.
i have the file janApplet.class and janAppletHtml.html in the directory c:\com\cpcc
I'm typing the following command at prompt:
>c:\jdk1.2.2\bin\appletviewer -classpath c:\com\cpcc C:\com\cpcc\janAppletHtml.html
here are the two files:
<title>Hello World Applet</title>
<applet codebase="c:\com\cpcc"code="janApplet.class" width=300 height=100>
import java.applet.*;
import java.awt.*;
public class janApplet extends Applet
public void init()
Button b=new Button();


please let me know what is the problem.
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Darine,
Two things jump out:
1. Don't include C: in anything because the paths are relative not absolute. You also should not be required to use the ClassPath parameter for the appletviewer.
2. Since your HTML file and Class file are in the same directory you don't need to the codebase tag in the HTML.
To recap:
1. c:\jdk1.2.2\bin\appletviewer com\cpcc\janAppletHtml.html
2. < APPLET CODE="janApplet.class" WIDTH=300 HEIGHT=100 >< /APPLET >
darine darine
Ranch Hand

Joined: Mar 08, 2001
Posts: 43
Thanks a lot.
I agree. Here's the link:
subject: I/O exception while reading: C:\-classpath..?
It's not a secret anymore!