Re: Convention for location of jar files
On 2/7/2015 12:57 PM, Knute Johnson wrote:
On 02/07/2015 07:09 AM, Noman Shapiro wrote:
Is there a convention, or perhaps conventions, for the location of jar
files,
for use by scripts with commands like "java -jar
someDirectory/foobar.jar" ?
There is a package convention.
com.yournameoruniqueidentifier.packagename...
So that would be your directory hierarchy too. I keep them under my
home directory on both Windows and Linux. So on Windows my directory
structure is:
C:\Users\Knute Johnson\com\knutejohnson\customer\packagename\...
on Linux
/home/knute/com/knutejohnson/customer/packagename/...
>
> When I deliver a program to a customer, I can use this same directory
> structure
That is the location of the class files.
It is not that logical to put the jar files there as very often
a jar file contains multiple packages.
I would say that both main class jar file and lib jar files
should go to an application specific dir.
> or a simpler one where just the end package directory is
> created in the customer's home directory. I store all data files in
> the same place too.
Yes.
> When you create your program and the manifest file for your program
> jar file you can use relative paths to define the location of any
> library jar files.
Same dir or a lib sub dir are two very common options.
Arne