Link to home
Start Free TrialLog in
Avatar of mte01
mte01Flag for Lebanon

asked on

Libaray Settings in JAR files

Hey experts,

I am using JBuilder 6.0, and I am creating a JAR for my applet. When you are setting the Libarary settings for each of the components that you are including in the JAR there are four options:

1- Never include any classes or resources.
2- Include required classes and known resources
3- Include required classes and all resources
4- Always include all classes and resources

Can someone explain the difference between these options (when to chose each), and more importantly the difference between a class and a resource.

Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

>>and more importantly the difference between a class and a resource.


Well i can answer that bit. A 'resource' is effectively any file required by your app that *isn't * a class. e.g. text files, images etc.
Avatar of mte01

ASKER

The probelm that I am facing here is that unless I include all the classes and resources (4th option) the browser wouldn't run the applet (it wouldn't find a Borland class that I am using). Moreover, including all these classes takes time in the compile process when you are testing your program, so what I need to know is that why do I need to include all the classes (why not only the required ones) when creating the JAR file.
SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mte01

ASKER

Okk I see.

I'll keep the question open for a few hours to see if someone can have a better solution and then give the proper credit.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mte01

ASKER

Ahaa Thank you.....but I still don't see why including the required classes won't make the applet run in the browser (see my 1st comment)
Avatar of doronb
doronb

I think that JBuilder can't correctly discover the correct dependency tree for your applet.

Is your applet a signed applet?
Avatar of mte01

ASKER

I've heard of signed software, but signed applets???
>>Is your applet a signed applet?
I think this problem may not be related with signed applet
mte01

Actually what dependency classes u need to include in your jar file??
Avatar of mte01

ASKER

I imported
com.borland.jbcl.layout.XYLayout;
com.borland.jbcl.layout.XYConstraints;

which are the ones that I used directly, and in the JAR file settings I chose "Include required classes and all resources" in the dependency tab, but when I run my applet in the browser it won't find the XYLayout class. When I include all classes, the problem doesn't occur, and the program runs smoothly.
OK I suggest you one rude manual rude operation

If u know the jar file of that classes

<applet code=YourApllet.class
      archive="yourclasses.jar ,  borlandjar.jar"
      width=460 height=160>
      <param name=foo value="bar">
    </applet>

Avatar of mte01

ASKER

>> OK I suggest you one rude manual rude operation

what???
if you know the jar file name for these classes

com.borland.jbcl.layout.XYLayout;
com.borland.jbcl.layout.XYConstraints;

then u can simply include that jat file  in ur applet code

Hope you understand

ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mte01

ASKER

Ahaa okk...I think I understood

>> <param name=foo value="bar">

What is this line for??
Nothing to do with that
that is just an example ;-)
Avatar of mte01

ASKER

It worked! Perfect!! But I think that this is a really nasty way to do it. My supervisor is going to kill me when he sees the HTML file of the Applet. Anyway, thank you  sudhakar_koundinya, and everyone who helped me in this
Avatar of mte01

ASKER

Nobody still told me what's a signed applet.....:)
We need signed applet when we deal with security related operations such as accessing client system's resources
Regards
Sudhakar
You can understand abt signed applet by lloing at this article
http://java.sun.com/security/signExample/
>>But I think that this is a really nasty way to do it.

It's actually the proper way to do it ;-) , but sudhakar, i think you mean 'crude' not 'rude' ;-)
>>but sudhakar, i think you mean 'crude' not 'rude' ;-)

Indians English is quite poor. They understand the language, but when time comes to express their thoughts in English. They fail in it. Hehehehe
Avatar of mte01

ASKER

>> I suggest you one (c)rude manual (c)rude operation

So can I ask what does a manual crude operation then mean??
Rude used to mean the same as crude but now means obscene or impolite, which could cause some confusion when used of jar files ;-)