The Artima Developer Community
Sponsored Link

Java Answers Forum
Running Applet Classes from Packages

3 replies on 1 page. Most recent reply: Jan 31, 2003 10:56 AM by Kishori Sharan

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
Ryan

Posts: 7
Nickname: rype69
Registered: Jan, 2003

Running Applet Classes from Packages Posted: Jan 30, 2003 3:19 AM
Reply to this message Reply
Advertisement
I'm writing a package of classes, the main of which is an applet which refuses to run correctly unless it doesn't have "package storm;" at the top of the file. It says java.lang.noClassDefFoundError.Storm (wrong name: storm/Storm) in the browser (ie). Why is that?

Ryan, UK.


Kishori Sharan

Posts: 211
Nickname: kishori
Registered: Feb, 2002

Re: Running Applet Classes from Packages Posted: Jan 30, 2003 10:00 AM
Reply to this message Reply
There are two ways to fix this problem:

1. Use CODEBASE attribute and place your applet class in appropriate folder according to your package. In fact, codebase acts like classpath for applet. Use fully qualified name in CODE

2. Use archive attribute for applet tag and place all your code in a jar file.

Thanks
Kishori

shruti

Posts: 1
Nickname: shruth
Registered: Jan, 2003

Re: Running Applet Classes from Packages Posted: Jan 31, 2003 8:08 AM
Reply to this message Reply
Kishori Please tell me about Archieve attribute of applet tag

Kishori Sharan

Posts: 211
Nickname: kishori
Registered: Feb, 2002

Re: Running Applet Classes from Packages Posted: Jan 31, 2003 10:56 AM
Reply to this message Reply
In case your applet uses more than one class files , you can pack them all in one in a jar file. Then , for applet tag you need to specify that jar file name for archive attribute. Suppose, you have packed all class files in myapplet.jar file. Then your applet tag should look like:
<applet code"p1.A1.class" archive="myapplet.jar">
</applet>
If you have more than one jar files then you can specify them all as a comma separated list. For more details on applet tag please visit the following link:

http://java.sun.com/docs/books/tutorial/applet/appletsonly/html.html

Thanks
Kishori

Flat View: This topic has 3 replies on 1 page
Topic: simple help needed Previous Topic   Next Topic Topic: Constructor not being called

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use