Solved

Libraries and jar files.

Posted on 2000-03-08
9
416 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
ID: 2596395
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
ID: 2597101
Mine is an applet -- What exactly do I type in  the HTML tag?
0
 

Expert Comment

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

Author Comment

by:Sasha_Mapa
ID: 2600350
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Expert Comment

by:ori_b
ID: 2600385
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
ID: 2600415
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
ID: 2600449
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
ID: 2600569
Ok, I'll try this today, if it works, I'll give you the points.
0
 
LVL 7

Author Comment

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Python Assistance 7 73
Java passing arguments (type error) 2 48
Groovy:unable to resolve class error 2 70
Java / Linux and Regular Expressions 11 71
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

863 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

21 Experts available now in Live!

Get 1:1 Help Now