[blfs-support] Trouble with OpenJDK-

Alan Feuerbacher alanf00 at comcast.net
Tue Dec 3 17:10:22 PST 2013

On 12/3/2013 8:37 AM, Pierre Labastie wrote:
> Le 03/12/2013 14:01, Alan Feuerbacher a écrit :
>> In installing OpenJDK- I've got to the BLFS book's
>> section "Configuring OpenJDK". I'm confused by the instructions.
>> The 1st instruction says:
>> <<<<<<<<
>> There are now two OpenJDK SDKs installed in /opt. You should decide on
>> which one you would like to use as the default. For example if you
>> decide to use the precompiled OpenJDK, do the following as the root user:
>> ln -v -nsf OpenJDK- /opt/jdk
> This create a symbolic link /opt/jdk-->OpenJDK-, that is,
> when you set:
>>    >>>>>>>>
>> The 2nd instruction contains the line "JAVA_HOME=/opt/jdk".
> JAVA_HOME is actually pointing to /opt/OpenJDK-
> Just remove '-bin' if you want to use the just compiled OpenJDK.
>> The 3rd instruction has several references to "opt/jdk".
>> The 4th instruction has the line "cd /opt/jdk".
>> So these instructions assume that somewhere in the instructions above,
>> the directory "/opt/jdk" has been created.
> No. /opt/jdk is a pointer to a directory, not a directory itself.
>> But nowhere above do I see
>> that directory being created.
>> The 1st instruction has you create a link that I don't understand. Since
>> I want to use the COMPILED OpenJDK, I did not execute the "ln" command.
>> After things did not work, I experimented and did this:
>> mkdir /opt/jdk
> Do not do that, just the next line (rmdir /opt/jdk first):
>> ln -v -nsf OpenJDK- /opt/jdk
>> This created a link in /opt/jdk: "OpenJDK- -> OpenJDK-"
>> which I don't understand.
> There are some variations on the ln -s syntax:
> ln -s <path/name> <path2>, creates a symbolic link inside the directory
> referred to by <path2>, whose name is <name>, and pointing to <path/name>...
> Now:
> ln -s <path1/name1> <path2/name2>, creates a symbolic link <name2>,
> pointing to <path1/name1>, inside the directory refrred to by path2. If
> path1 is a relative path, it is relative to path2.
> So, if the second argument is a path to a directory, it creates
> something inside it. If it is a path to a non-existent file, it creates
> that file. I think it fails if the second argument is an already
> existing file.
> More information at "man ls".
> Regards
> Pierre

Thank you for explaining that. What you and Fernando explained is much 
clearer than what's in the man page for "ln".

My mistake was in failing to note that when the BLFS book said that one 
option was to make this link:

ln -v -nsf OpenJDK- /opt/jdk

that the other option -- not explicitly stated but apparently implied -- 
was to make this link:

ln -v -nsf OpenJDK- /opt/jdk

Perhaps it would be helpful to relative beginners like me for these two 
options to be called out explicitly. I found the instructions ambiguous; 
hence my mistake.


More information about the blfs-support mailing list