[blfs-support] Trouble with OpenJDK- Installation

Pierre Labastie pierre.labastie at neuf.fr
Tue Dec 3 05:37:26 PST 2013

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>...
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".


More information about the blfs-support mailing list