Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Package import / Distribution Question

 
Cecil Phillip
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I recently got a api(which is basically a single package) to help me work on mp3 tags. I have a fair understanding of how put the package to use but I just need a few things cleared.
1. How\Where can I put the package such that it wouldn't have to be in the same directoty for me to import it into a project; kinda making it like an extension of the core api ?
2. When distributing programs that use this package, would I have to include the entire package alot with the rest of the project's classes ?
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Cecil,

1. How\Where can I put the package such that it wouldn't have to be in the same directoty for me to import it into a project; kinda making it like an extension of the core api ?

You can put it in the <SDK>/jre/lib/ext/ dirctory, but that's probably not a real great idea since that is really for true Java extensions like the Java3D lib. Admittedly, I put some libs in there that I use a lot like the MySql JDBC driver lib. You're really better off creating a project directory and putting the lib there. For example, if you have a package mp3.tags and com.cecil.myproject, then you would want a dirctory structure like:
MyProject/mp3/tags // tags source here
MyProject/com/cecil/myproject // your source here
If you do that, then it is going to be much easier to jar it up for distribution.

2. When distributing programs that use this package, would I have to include the entire package alot with the rest of the project's classes ?

Yep, unless you get very lucky and the machine already has the non-standard package there and the CLASSPATH is set to locate it. All in all you probably win the lottery before that happens. As I said earlier, for distribution, you'll want to jar it anyway and can easily include both packages in the jar.
Michael Morris
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic