Showing posts with label symlink. Show all posts
Showing posts with label symlink. Show all posts

Friday, 9 January 2015

Java is not found on your Linux ? It might be the symlinks in /usr/bin that cause this...

It may happen that you have installed Java on your Linux system but it is not recognized as installed and existing.
Check out in /usr/bin directory these symbolic links:
/usr/bin/java
/usr/bin/javaw
They should be pointing to your Java installation folder's and the executables there. For example:

$ ll /usr/bin/java*
  java -> /etc/alternatives/java
  javaws -> /usr/java/latest/bin/javaws

In this case, the first symbolic link is not updated to the latest or default Java bin folder and this may be causing issues.
Change it to point to:
/usr/java/latest/bin/java

and the final result should be:

$ ll /usr/bin/java*
  java -> /usr/java/latest/bin/java
  javaws -> /usr/java/latest/bin/javaws

In my particular case, I wasn't able to find java on my remote Linux machine via SSH connection through PuTTY and adjusting the symlinks in /usr/bin fixed my problem.


Monday, 6 January 2014

Remove a symbolik link in Linux

Symbolik link is one that points to a file or directory, a kind of shortcut.
When it needs to be removed and you use the auto fill in of commands in the shell (TAB key) and you type rm then the name of the link, it will automatically add the name of the link and add a slash. This slash must be deleted in the command in order to be able to delete the symlink.

# correct way 
rm mySymLink
# incorrectly added slash
rm mySymLink/
 
The first one means you delete a file (which actually is the symlink) while the second is you want to delete a directory.
That's why you will get error you try to delete directory.
Also file permissions might be needed to be set up. 

Wednesday, 20 February 2013

Symbolik links (soft link)

$ ln -s /path/to/link/to   /place/symlink/here

$ ln -s /home/user/   MySymlink
will create symbolik link "MySymlink" that will link to the path /home/user