Solved

Libraries and jar files.

Posted on 2000-03-08
9
423 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

 
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

707 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