Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Where to put new packages (JARs)?  RSS feed

 
Stephen Hanley
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This may seem like an elementary question but where do I put new packages?

I have downloaded the JAR for the Jakarta Commons package and am trying to deploy it on my server. What directory do I put it in?

On another forum I was led to believe that I put it in the directory referenced to in the Classpath variable of my Environment Variables?

KR,

Steve.
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37249
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Steve,
Welcome to JavaRanch!

You are correct that the jar needs to be in your application's classpath. You should also place the jar in your EAR or WAR file so it is self contained.
 
Stephen Hanley
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm quite new to Enterprise Java. Final Year studentin information Systems Development.

By EAR and WAR files you mean the .jar (Business module) and .war (Web Module)?

If so, I did that and still not seeing the packages. Do I need to do something with Apache ANT to get these to work?
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37249
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stephen,
Yes I mean web module when I say WAR. In particular, you want to put it in the WEB-INF directory. An EAR file is used when you have EJBs in your app in addition to servlets/JSPs. This is probably beyond the scope of what you are doing.

For a school project, you can probably just add the jar to the system classpath (if you own the machine.) Placing them in the WAR is to avoid conflicts with other apps.

When you say "see the packages", I assume you mean reference them from other java classes? You wouldn't actually see anything.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!