Solved

Libraries and jar files.

Posted on 2000-03-08
9
417 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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
 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to get all the API from website? 11 84
topping3 challenge 14 79
starter POM and spring-boot-starter,  spring-boot-web 2 54
Problem to Alipay 10 18
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

805 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