You are viewing a plain text version of this content. The canonical link for it is here.
Posted to regexp-user@jakarta.apache.org by Stephen Tang <St...@msdw.com> on 2000/11/08 15:51:53 UTC

REDemo.java doesn't seem to work as an applet

Hi,
According to the javadocs, REDemo.java is supposed to be an interactive
demo and testing facility.

I compiled REDemo into a class file with no problems, then created a
test.html with an <APPLET> tag referencing REDemo.class.

I use appletviewer on test.html and I get the following "wrong name"
error:

I am pretty sure I set the classpath correctly.   Anybody have any idea
why REDemo.java doesn't work.

Thank you for your time.

Sincerely,
Stephen


C:\jakarta-regexp-1.1\src\java\org\apache\regexp>appletviewer test.html
java.lang.NoClassDefFoundError: REDemo (wrong name:
org/apache/regexp/REDemo)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
        at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:11
1)
        at
sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:142)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
        at
sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:108)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
        at
sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:366)
        at sun.applet.AppletPanel.createApplet(AppletPanel.java:579)
        at sun.applet.AppletPanel.runLoader(AppletPanel.java:515)
        at sun.applet.AppletPanel.run(AppletPanel.java:293)
        at java.lang.Thread.run(Thread.java:484)

Re: REDemo.java doesn't seem to work as an applet

Posted by Stephen Tang <St...@msdw.com>.
Hi again,
It still doesn't work.  Error message below.

My classpath has "C:\jakarta-regexp-1.1\src\java" beacuse the
REDemo.java is a package of "org.apache.regexp"

I've tried the following applet tags:
<applet code="org.apache.regexp.REDemo.class" height="400"
width="400"></applet>
<applet code="org.apache.regexp.REDemo" height="400"
width="400"></applet>
<applet code="REDemo" height="400" width="400"></applet>
<applet code="REDemo.class" height="400" width="400"></applet>

I either get "Wrong name" or "can't find file" errors.

Am I missing something here?

Thank you.

Sincerely,
Stephen

Re: REDemo.java doesn't seem to work as an applet

Posted by "David M. Karr" <dk...@tcsi.com>.
>>>>> "Stephen" == Stephen Tang <St...@msdw.com> writes:
  Stephen> Hi,
  Stephen> According to the javadocs, REDemo.java is supposed to be an interactive
  Stephen> demo and testing facility.

  Stephen> I compiled REDemo into a class file with no problems, then created a
  Stephen> test.html with an <APPLET> tag referencing REDemo.class.

  Stephen> I use appletviewer on test.html and I get the following "wrong name"
  Stephen> error:

  Stephen> I am pretty sure I set the classpath correctly.   Anybody have any idea
  Stephen> why REDemo.java doesn't work.

The class name is "org.apache.regexp.REDemo", not "REDemo".  That is
the root of your problem.

-- 
===============================================================================
David M. Karr     ; dkarr@tcsi.com  ; w:(425)487-8312 ; TCSI & Best Consulting
Software Engineer ; Unix/Java/C++/X ; BrainBench CJ12P (#12004)


Re: REDemo.java doesn't seem to work as an applet

Posted by Stephen Tang <St...@msdw.com>.
REDemo has "extends Applet" and implements TextListener.
I have to rewrite REDemo.java?

Thanks.

Jon Stevens wrote:
> 
> on 11/8/2000 6:51 AM, "Stephen Tang" <St...@msdw.com> wrote:
> 
> > Hi,
> > According to the javadocs, REDemo.java is supposed to be an interactive
> > demo and testing facility.
> >
> > I compiled REDemo into a class file with no problems, then created a
> > test.html with an <APPLET> tag referencing REDemo.class.
> >
> > I use appletviewer on test.html and I get the following "wrong name"
> > error:
> >
> > I am pretty sure I set the classpath correctly.   Anybody have any idea
> > why REDemo.java doesn't work.
> >
> > Thank you for your time.
> >
> > Sincerely,
> > Stephen
> 
> I just run it from the command line as an application instead of an applet.
> 
> -jon
> 
> --
> http://scarab.tigris.org/    | http://noodle.tigris.org/
> http://java.apache.org/      | http://java.apache.org/turbine/
> http://www.working-dogs.com/ | http://jakarta.apache.org/velocity/
> http://www.collab.net/       | http://www.sourcexchange.com/

Re: REDemo.java doesn't seem to work as an applet

Posted by Jon Stevens <jo...@latchkey.com>.
on 11/8/2000 6:51 AM, "Stephen Tang" <St...@msdw.com> wrote:

> Hi,
> According to the javadocs, REDemo.java is supposed to be an interactive
> demo and testing facility.
> 
> I compiled REDemo into a class file with no problems, then created a
> test.html with an <APPLET> tag referencing REDemo.class.
> 
> I use appletviewer on test.html and I get the following "wrong name"
> error:
> 
> I am pretty sure I set the classpath correctly.   Anybody have any idea
> why REDemo.java doesn't work.
> 
> Thank you for your time.
> 
> Sincerely,
> Stephen

I just run it from the command line as an application instead of an applet.

-jon

-- 
http://scarab.tigris.org/    | http://noodle.tigris.org/
http://java.apache.org/      | http://java.apache.org/turbine/
http://www.working-dogs.com/ | http://jakarta.apache.org/velocity/
http://www.collab.net/       | http://www.sourcexchange.com/