Solved

Libraries and jar files.

Posted on 2000-03-08
9
413 Views
Last Modified: 2013-11-23
I have written a library. It is in a com/telmap/mapapplet directory.
A. How do I put all the class files in a jar file so that I can use the library from within the jar file?
B. Where do I place the jar file relatively to the code that wants to use it?
0
Comment
Question by:Sasha_Mapa
  • 5
  • 3
9 Comments
 
LVL 1

Expert Comment

by:dmaguillo
Comment Utility
A. Making your .jar file:
     jar cvf myjar.jar com/telmap/mapapplet/*.class

B. You can put your .jar file where you want. Only must refer it in a CLASSPATH. For example, if "myjar.jar" is located in C:\com\jars:

CLASSPATH=%CLASSPATH%;c:\com\jars\myjar.jar

Is it´s an applet, you can refer it through tag ARCHIVE in the .html. With CLASSPATH runs too.

Another posibility with main programs will be:

java -jar myjar.jar

Bye... :)
0
 
LVL 7

Author Comment

by:Sasha_Mapa
Comment Utility
Mine is an applet -- What exactly do I type in  the HTML tag?
0
 

Expert Comment

by:ori_b
Comment Utility
Your HTML tag should look like this :
<APPLET CODE = classname.class ARCHIVE = myjar.jar>
</APPLET>
0
 
LVL 7

Author Comment

by:Sasha_Mapa
Comment Utility
But I already have the whole applet in a jar file, so my HTML tag already looks like:
<APPLET CODE = MyApplet.class ARCHIVE = MyJarredApplet.jar>
</APPLET>
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Expert Comment

by:ori_b
Comment Utility
where is MyApplet.class  located in the jar ?
if it is in com/telmap/mapapplet/ then
you tag should change to:

<APPLET CODE = com.telmap.mapapplet.MyApplet.class ARCHIVE = MyJarredApplet.jar>
</APPLET>


0
 
LVL 7

Author Comment

by:Sasha_Mapa
Comment Utility
No, I want to have 2 jar files, one with the applet, and another one with the com.telmap.mapapplet library. I want to run the applet, which would use the library.
0
 

Accepted Solution

by:
ori_b earned 10 total points
Comment Utility
Sorry, I didn't understand this before,
what you can try is this :

<APPLET CODE = MyApplet.class ARCHIVE = "MyJarredApplet.jar , MyLibrary.jar">
</APPLET>

assuming MyLibrary.jar is the
com.telmap.mapapplet library jar file
0
 
LVL 7

Author Comment

by:Sasha_Mapa
Comment Utility
Ok, I'll try this today, if it works, I'll give you the points.
0
 
LVL 7

Author Comment

by:Sasha_Mapa
Comment Utility
It worked! Sorry for the delay, had to do other things before :-)
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now