aspose file tools*
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
Author

jar path on linux

arjun rampal
Ranch Hand

Joined: Jul 08, 2005
Posts: 125
Hi

I was giving propertie file path in java class like this

public static final String APPLICATION_PROPERTY_FILE_PATH ="\\\\machinename.com +
"\\workspace\\Agr\\JavaSource";

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

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

now what path i should give for linux

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

regards
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16012
    
  19

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/application.properties" 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/application.properties, 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.


Customer surveys are for companies who didn't pay proper attention to begin with.
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 application.properties file in home/wasdmin/jar/application.properties .
jar folder also contains b.jar which has following java files

folowing are the three files constants.java
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jar path on linux