dkim18
asked on
Running applet locally: class not found error
I am trying to run applet on my home pc, but having trouble.
The followings are directory layout after creating jar of classes files and resources with.
From $C;\classes:
Jar cvf dkim18.jar images dkim18
C:\src\dkim18\library\Libr aryApplet. java
C:\classes\images\CheckOut .gif
C:\classes\images\CheckIn. gif
C:\classes\dkim18\library\ LibraryApp let$1.clas s
C:\classes\dkim18\library\ LibraryApp let.class
C:\classes\dkim18.jar
C:\LibraryApplet.html
And this is my applet tag in LibraryApplet.html.
<applet code="dkim18.library.Libra ryApplet.c lass"
codebase="classes"
archive="classes\dkim18.ja r"
width="900" height="300">
When I try to run, I have “class dkim18.library.LibraryAppl et not found” error. Why can’t appletviewer find class?
Thank you your help
The followings are directory layout after creating jar of classes files and resources with.
From $C;\classes:
Jar cvf dkim18.jar images dkim18
C:\src\dkim18\library\Libr
C:\classes\images\CheckOut
C:\classes\images\CheckIn.
C:\classes\dkim18\library\
C:\classes\dkim18\library\
C:\classes\dkim18.jar
C:\LibraryApplet.html
And this is my applet tag in LibraryApplet.html.
<applet code="dkim18.library.Libra
codebase="classes"
archive="classes\dkim18.ja
width="900" height="300">
When I try to run, I have “class dkim18.library.LibraryAppl
Thank you your help
>>Means that the class must be in package...
...which of course means that the source of LibraryApplet must start
package dkim18.library;
...which of course means that the source of LibraryApplet must start
package dkim18.library;
ASKER
...2003 META-INF/
...2003 META-INF/MANIFEST.MF
...2003 images/
...2003 images/CheckIn.gif
...2003 images/CheckOut.gif
...2003 images/Thumbs.db
...2003 dkiim18/
...2003 dkim18/library/
...2003 dkim18/library/LibraryAppl et$1.class
...2003 dkim18/library/LibraryAppl et.class
I already included package dkim18.library in my LibraryApplet.java file.
thanks,
...2003 META-INF/MANIFEST.MF
...2003 images/
...2003 images/CheckIn.gif
...2003 images/CheckOut.gif
...2003 images/Thumbs.db
...2003 dkiim18/
...2003 dkim18/library/
...2003 dkim18/library/LibraryAppl
...2003 dkim18/library/LibraryAppl
I already included package dkim18.library in my LibraryApplet.java file.
thanks,
ASKER
I mean...I still have same error.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What happens when you run
java -classpath dkim18.jar dkim18.library.LibraryAppl et
?
java -classpath dkim18.jar dkim18.library.LibraryAppl
?
Or rather
appletviewer ...
not
java ...
appletviewer ...
not
java ...
ASKER
<applet code="dkim18.library.Libra ryApplet.c lass"
archive="classes/dkim18.ja r"
width="900" height="300">
doesn't work either.
if I run java -classpath dkim18.jar dkim18.library.LibraryAppl et
I get NoClassDefFoundError.
if I run appletviewer -classpath dkim18.jar dkim18.library.LibraryAppl et -classpath doen't get supperted and if I run appletviewer dkim18.jar dkim18.library.LibraryAppl et, then I have I/O error
archive="classes/dkim18.ja
width="900" height="300">
doesn't work either.
if I run java -classpath dkim18.jar dkim18.library.LibraryAppl
I get NoClassDefFoundError.
if I run appletviewer -classpath dkim18.jar dkim18.library.LibraryAppl
can you move the archive out of the classes folder into the same folder as the html, and try:
<applet code="dkim18.library.Libra ryApplet.c lass"
archive="dkim18.jar"
width="900" height="300">
?
Are you sure the class:
LibraryApplet.class
is inside the package
dkim18.library
and it's inside the folder
/dkim18/library in the jar file?
<applet code="dkim18.library.Libra
archive="dkim18.jar"
width="900" height="300">
?
Are you sure the class:
LibraryApplet.class
is inside the package
dkim18.library
and it's inside the folder
/dkim18/library in the jar file?
>>
if I run java -classpath dkim18.jar dkim18.library.LibraryAppl et
I get NoClassDefFoundError.
>>
Try
appletviewer -J-classpath -Jdkim18.jar dkim18.library.LibraryAppl et
if I run java -classpath dkim18.jar dkim18.library.LibraryAppl
I get NoClassDefFoundError.
>>
Try
appletviewer -J-classpath -Jdkim18.jar dkim18.library.LibraryAppl
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
can you move the archive out of the classes folder into the same folder as the html, and try:
<applet code="dkim18.library.Libra ryApplet.c lass"
archive="dkim18.jar"
width="900" height="300">
>>I did, but didn't work
Are you sure the class:
LibraryApplet.class
is inside the package
dkim18.library
and it's inside the folder
/dkim18/library in the jar file?
>>Yes
Try
appletviewer -J-classpath -Jdkim18.jar dkim18.library.LibraryAppl et
>>same I/O error
Incidentally, move that jar well away from the directories in question before testing, or there could be all kinds of confusion.
>>I moved jar file away but didn't help, indeed I need jar file under classes dir for this project.
<applet code="dkim18.library.Libra
archive="dkim18.jar"
width="900" height="300">
>>I did, but didn't work
Are you sure the class:
LibraryApplet.class
is inside the package
dkim18.library
and it's inside the folder
/dkim18/library in the jar file?
>>Yes
Try
appletviewer -J-classpath -Jdkim18.jar dkim18.library.LibraryAppl
>>same I/O error
Incidentally, move that jar well away from the directories in question before testing, or there could be all kinds of confusion.
>>I moved jar file away but didn't help, indeed I need jar file under classes dir for this project.
ASKER
I did solve the problem. I didn’t update jar file. I compile and then should create jar file.
I am sorry for my ignorance and thank you for all your answers. Since this was my fault I will still give points whoever answered to my question.
I am sorry for my ignorance and thank you for all your answers. Since this was my fault I will still give points whoever answered to my question.
ASKER
When I tried to split the points, it says i need to select at least two accepted ansewers, but
I can't select two accepted ansewers even though I use ctrl key. How do I do it?
I can't select two accepted ansewers even though I use ctrl key. How do I do it?
! LOL. Never mind - easily done. Happy to split points with Tim...
>>I can't select two accepted ansewers even though
Just use the radio button/ check box (can't remember which now)
Just use the radio button/ check box (can't remember which now)
Yes - what you have to do is use one radio button but two text boxes for inserting points
:-)
Glad you got it sorted :-)
Good luck!!
And thanks!!
Tim
Glad you got it sorted :-)
Good luck!!
And thanks!!
Tim
:-)
Means that the class must be in package
dkim18.library
Please print the contents of jar and post
jar -tvf dkim18.jar