LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 12-16-2008, 05:27 AM   #1
Mark_667
Member
 
Registered: Aug 2005
Location: Manchester, England
Distribution: Ubuntu 12.10
Posts: 260

Rep: Reputation: 25
Setting the LD_LIBRARY_PATH


When trying to launch an application I get a java.lang.UnsatisfiedLinkError: no <libname> in java.library.path

I've put export LD_LIBRARY_PATH= statements in the .bash_profile of the user I'm logged in as and in /etc/profile
but when I type 'echo $LD_LIBRARY_PATH' at the command line I get a blank line returned. The last line of the 'set' command output where the LD_LIBRARY_PATH output is reads:
_=<path to jar file I want to execute>
although I have only specified paths to directories not individual files in the LD_LIBRARY_PATH

When I execute the jar file from the command line with the -Djava.library.path= specified as an argument I get a different (but I think unrelated error) Can anyone shed some light on this?
 
Old 12-16-2008, 09:03 AM   #2
uks
Member
 
Registered: Jul 2007
Posts: 68

Rep: Reputation: 16
I hope you have relogged in after you put this in the profile files.
They are read only on login.
If they still dont work export it from the command prompt like this:

export LD_LIBRARY_PATH=/xxx/yyy

and then echo it once to check.
This should work

--Ukesh Upendran

Last edited by uks; 07-24-2009 at 05:20 AM.
 
Old 12-16-2008, 11:49 AM   #3
Mark_667
Member
 
Registered: Aug 2005
Location: Manchester, England
Distribution: Ubuntu 12.10
Posts: 260

Original Poster
Rep: Reputation: 25
I've changed the /etc/profile and the user's and root's .bashrc to contain:
LD_LIBRARY_PATH=/usr/ofed/lib:<other colon-seperated entries here>

export LD_LIBRARY_PATH

and yes, I have been logging out and in again for the changes to take affect. For some reason, though, launching the jar file from command line doesn't give me this problem but executing the same command from a launcher on the desktop (I'm using RHEL 4) does.
 
Old 12-16-2008, 12:12 PM   #4
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,549

Rep: Reputation: 180Reputation: 180
You can make the library universally available with the ldconfig command. Log in as root and add the library to the /etc/ld.so.conf file. Then run the ldconfig command as root. See:

man ldconfig

----------------------
Steve Stites
 
Old 12-17-2008, 11:26 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,938

Rep: Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601Reputation: 2601
A jar file cannot be run directly from a Desktop Entry.

Make a shell script with your java -jar command ..
Quote:
#!/bin/sh
cd <path-to-jar-file>
exec java -jar file.jar
Name the script, make it executable, cp the script to
/usr/local/bin/

Now you can call the script from a Desktop Entry with
exec=scriptname .
....

Last edited by knudfl; 12-17-2008 at 11:29 AM.
 
  


Reply

Tags
ldlibrarypath


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ld_library_path newbie_adm Linux - Newbie 2 08-30-2006 08:52 AM
Permanently Set a Export Setting (LD_LIBRARY_PATH) nistelrooy Linux - General 1 11-25-2004 11:33 AM
Ld_library_path fng_#1 Linux - Software 4 09-19-2004 11:33 PM
setting LD_LIBRARY_PATH JonyKyte Linux - Newbie 1 02-14-2004 12:26 PM
Ld_library_path ? dahmad Linux - Newbie 5 02-21-2003 11:08 PM


All times are GMT -5. The time now is 04:52 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration