• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
--------------------------------
<HTML>
<HEAD>
<title>Hello World Applet</title>
</HEAD>
<BODY>
<applet codebase="c:\com\cpcc"code="janApplet.class" width=300 height=100>
</applet>
</BODY>
</HTML>
-------------------------------
import java.applet.*;
import java.awt.*;
public class janApplet extends Applet
{
public void init()
{
Button b=new Button();
add(b);

}

}
please let me know what is the problem.
thanks.
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 >
Regards,
Manfred.
 
darine darine
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot.
 
Replace the word "snake" with "danger noodle" in all tiny ads.
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic