File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Linux / UNIX and the fly likes jar path on linux Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "jar path on linux" Watch "jar path on linux" New topic

jar path on linux

arjun rampal
Ranch Hand

Joined: Jul 08, 2005
Posts: 125

I was giving propertie file path in java class like this

public static final String APPLICATION_PROPERTY_FILE_PATH ="\\\\ +

Now issue is this I deployed this as jar file on linux like b.jar.

Now it is complaining that Unable to locate resource obviously becuase of window path.

now what path i should give for linux

my jar is in home/ras/jar/b.jar/

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17417

It looks like you are attempting to locate the jar via a UNC name. However, the Windows UNC convention isn't directly supported by unix-style OS's.

On Linux, you can create a mountpoint and do things like

smbmount //myserver/myshare /mnt/myshare

Which causes an alias point to be defined in the filesystem. But you can't code "//myserver/myshare/jar/b.jar/" inside a Java program. Well you can, but it won't do anything like what you want. The smbmount command can make the file visible at /mnt/myshare/jar/b.jar/, but not only does this require an external smbmount command to be issued to setup the mountpoint, but "b.jar" would have to be the name of a directory, not a jar file, since the filesystem also doesn't support treating jars like they're directories.

smbmount is part of the Samba suite, BTW, so it only works if you have the Samba software installed.

There are tools that can give URL access to files inside jarfiles on arbitrary cifs shares, but you have to code the application to look for them and include the extra jars that are needed to make it possible.

An IDE is no substitute for an Intelligent Developer.
arjun rampal
Ranch Hand

Joined: Jul 08, 2005
Posts: 125
ok your solution is impossible for present linux so now i redifne my problem
I am keeping file in home/wasdmin/jar/ .
jar folder also contains b.jar which has following java files

folowing are the three files
I agree. Here's the link:
subject: jar path on linux
It's not a secret anymore!