readlink -f which runs in ubuntu doesnt really work right in Red hat any alternative?
Dear sir,
i am using the Code:
readlink -f $(which java) it gives output like Code:
/usr/lib/jvm/java-6-openjdk/jre/bin/java its giving me output Code:
/usr/bin/gij its not giving me location from jvm how can i get it please let me know Thanks, Reagrds rohan |
What makes you think the output is incorrect?
If you refer to the man page for readlink: Code:
-f, --canonicalize As is the same with your original output, just it is linked to the jvm version. |
Quote:
Thanks for rply i am getting your point but every where else in the Ubuntu machines i am getting the all path of active java like i told u earlier Code:
/usr/lib/jvm/java-6-openjdk/jre/bin/java actually i want to get the active jdk directory what i am doing in ubuntu is Code:
OUTPUT=$(readlink -f $(which java)) Thanks!!! regards rohan |
It is floored logic to say, something works in Ubuntu so why doesn't it work in Redhat. Whilst some thing may be the same, there is no set in stone fact that one distribution will handle
something exactly the same as another. What I can tell you is that if both machines had the exact same applications installed and no others, it may well be that you would get the same information returned. The fact of the matter is that the Redhat install you are looking at is not using jvm as its' copy of java but rather gij (whatever that happens to be) So I guess the first question I would be asking is, is there a relevant copy of java provided as a jvm installed (as part of jdk, jre, jse)? Also, does the path you are looking for exist? (the jvm one on the Redhat machine) Lastly, what does: Code:
which java |
Quote:
The path i am looking for is there because when i do Code:
update-alternatives --config java like Code:
/usr/lib/jvm/jre-1.4.2-gcj/bin/java thanks for reply sir regards rohan |
Well I am not overly familiar with update-alternatives as I do not use Ubuntu or Redhat, but just so I am following:
1. You have used the command update-alternatives and successfully changed /usr/bin/java to point to /usr/lib/jvm/jre-1.4.2-gcj/bin/java? 2. You have confirmed the following: Code:
$ which java |
Quote:
there was the only java available on this that machine and its currently active JAVA jdk thanks & Regards rohan |
Good Sir,
If you want to know where Java is, use environment variable JAVA_HOME (If it is set. If unset, do nothing.) |
Quote:
Its not set. . . how come Code:
readlink -f $(which java) any idea please let me know and thanks for your time. Regards rohan |
Use 'readlink -f /etc/alternatives/java'?
|
> > If you want to know where Java is, use environment variable JAVA_HOME (If it is set. If unset, do nothing.)
> Its not set. . . Then do nothing: Code:
if [ -z "$JAVA_HOME" ]; then |
Hi,
ohh, this game again. We played it once before for Debian (and derived) systems. https://www.linuxquestions.org/quest...re-4175468115/ So now you want to dump some .jar files on RHEL systems too. Have you considered using rpms? Also have you considered that you don't actually need to dump your files where the system files reside?I'm not a java guy, but a quick search found the following. http://docs.oracle.com/javase/tutori...ent/paths.html Evo2. |
|
Quote:
Thanks for valueable rply i agree about the fact of the symlinks are useful in compatibility, but is there any way to get the full path of actual directory i want to know the location because i want to install one java library bin file at active configuration directory through my script so have to know the location in ubuntu i am getting the location through Code:
readlink -f $(which java) Regards rohan |
Quote:
yes sir i am trying the same thing as i dont want to use the internet so not going for rpms i am trying to install the bin through script only is there any way to get the path (directory) of active java configuration. please let me know if there is any idea. or command that can be used Thanks & Regards Rohan |
All times are GMT -5. The time now is 02:44 AM. |