🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: csu.cs
Article #46

Java applet classpath

#46
From: Adam Carheden
Date: Mon, 27 Mar 2000 00:00
42 lines
1748 bytes
Mostly Java is a good language, but the #$@*( at Sun really )($#&@ up
when they invented that whole classpath thing.  Here's my problem:

My applet:
  package TestApplet;
  ...
  public class TestApplet extends applet {...}


The contentse of my .jar file:
  META-INF/
  META-INF/MANIFEST.MF
  TestApplet/
  TestApplet/TestApplet.class

My <Applet> tag:
  <applet code="TestApplet.class"
          archive="TestApplet.jar"
	  width="300" height="300">
    Your browser sucks!
  </applet>

My exception using appletviewer: 
load: class TestApplet.class not found.
java.lang.ClassNotFoundException: java.io.FileNotFoundException: 
http://mydomina.edu/correct/path/to/directory/containing/jar/file/TestApplet/class.class

What the heck is going on.  Why is it looking for class.class.  No,
there is no call to class.class in my TestApplet.java code. 
TestApplet.class works fine outside the .jar file.

If I try it with a codebase attrib pointing to the TestApplet URL
instead of an archive attrib in the <Applet> tag, I get:

java.lang.NoClassDefFoundError: TestApplet (wrong name:
TestApplet/TestApplet)

Someone please tell me how to use these @$#) .jar files!

-- 
Adam
carheden@cs.colostate.edu
Technical Details
Message-ID: <38DFFA13.DA60954A@careermail.colostate.edu>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 148df6,6a44699ac685f65e,start
X-Google-Attributes: gid148df6,public
From: Adam Carheden <acarheden@careermail.colostate.edu>
Subject: Java applet classpath
Date: 2000/03/27
Message-ID: <38DFFA13.DA60954A@careermail.colostate.edu>
X-Deja-AN: 603186969
Content-Transfer-Encoding: 7bit
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
X-Trace: 27 Mar 2000 17:08:29 -0700, 129.82.142.121
MIME-Version: 1.0
Newsgroups: csu.cs