• 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

Setting LD_LIBRARY_PATH in java in unix

 
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

System.getenv("LD_LIBRARY_PATH");
This prints the value of $LD_LIBRARY_PATH in unix.

How to set "LD_LIBRARY_PATH" through java?
System.setProperty("LD_LIBRARY_PATH",path) is not working.

There is no System.setenv()

Thanks,
Guru
 
Sheriff
Posts: 22784
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where do you need this for?
You cannot change environment variables for existing processes. The only way to change environment variables for any new process is to use the proper mechanisms; you would need to add it to your Bash profile configuration file, or its equivalent for your current shell.

However, if you launch processes from Java using Runtime.exec or ProcessBuilder, you can add extra environment variables to the new process. Check the documentation on how to.
 
if you think brussel sprouts are yummy, you should try any other food. And 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