• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jar path on linux

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
arjun rampal
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
She's out of the country right now, toppling an unauthorized dictatorship. Please leave a message with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic