I had bash as my default shell even though I was only using zsh.

I always started it myself by opening the terminal and typing zsh.

Today I decided to use it as my default shell. So I found this link and ran the following command

sudo chsh -s $(which zsh) john

where john is my user.

It all worked fine until I tried accessing my bank's website and noticed that the symbolic link I had created for the Java Chrome Plugin didn't work anymore.

I tried deleting it and creating a new one via zsh with this command:

sudo ln -s /opt/jre1.7.0_55/lib/amd64/libnpjp2.so

but it didn't work. Should I do something different now that I'm using zsh? How do I get my symbolic links working again?

  • How did you determine that the symlink was the cause of the problem? It seems more likely it would be something to do with how your java environment is set up in bash versus zsh (e.g. something java-related in your ~/.bashrc file). May 22, 2014 at 16:46
  • It might be that, I just assumed it because it is the same error I had before the symlink was first created. How can I pinpoint the problem? May 22, 2014 at 16:48
  • Please show us the errors. We can't help if all you tell us is "the same error as before" or "it didn't work". We need to know how it failed and with what error message. That will tell us what the problem is.
    – terdon
    May 22, 2014 at 17:16
  • There's no error, the only symptom I can identify is that chrome doesn't see the Java Plugin anymore, as if I had never configured it May 22, 2014 at 17:18

2 Answers 2


Without clarification about the errors that your browser is experiencing, I can only speculate, but here goes:

It seems entirely likely that your ~/.bashrc was setting certain environment variables and exporting them. When you then would invoke zsh manually, it would (as a child process of your bash shell) inherit those environment variables.

It would behoove you to investigate precisely which environment variables are being set when your initial bash session is started, before switching to zsh.

To do this, first invoke bash:

$ bash

Then examine your environment variables:

$ set

This output will be long. You may wish to pipe through a pager like more or less. Because you are experiencing problems with java, you may wish to verify that your JAVA_HOME environment variable is properly set in zsh. From bash, do:

$ echo $JAVA_HOME

Then exit from that bash session and verify that JAVA_HOME is correctly set in zsh by issuing the same echo command again.

If these do not match, you'll want to set it in your ~/.zshrc which you can do very easily by going back into bash and then echoing the variable contents into your .zshrc like this:

$ bash
$ echo "export JAVA_HOME=" $JAVA_HOME >> .zshrc
$ exit
  • I see that my question is vague and I apologize, I am a newcomer to the Linux world and the only thing that I could see is that the Java Plugin that used to work on Chrome when I created the symlink, now does not. I did some checking and $JAVA_HOME, $CLASSPATH and $PATH are all the same in zsh and bash May 22, 2014 at 17:50
  • No worries; you're asking questions and learning. Careful: how you switch between bash and zsh will affect whether or not environment variables are set. The way I have you check there implies a certain order of operations which matters. A more reliable check will be to do: grep JAVA_HOME .bashrc ; grep JAVA_HOME .zshrc and make sure those entries match.
    – James S.
    May 22, 2014 at 18:13
  • I actually configured the JAVA_HOME in a different way, it's in a file called java.sh inside /etc/profile.d/ May 22, 2014 at 18:23
  • In that case, it seems unlikely that your change of default shell has had any effect at all on the problems that you are seeing. Have you changed anything else? Have you done an OS update?
    – James S.
    May 22, 2014 at 18:37
  • No, the only real change I made was the command I specified in the question, I really don't know what this could be, and I don't really know how I should try and look it up on the web for hints May 22, 2014 at 18:50

First of all, there is absolutely no reason to run chsh with sudo! Next time, just run

chsh -s $(which bash) 

There is also absolutely no reason to use sudo ln. Links are world read/write/executable by every one. Now, the links you have created have nothing to do with the shell you sued. There is absolutely no reason why changing your shell would affect them. If you can't access a link, the problem is elsewhere.

Anyway, just run

ln -s /opt/jre1.7.0_55/lib/amd64/libnpjp2.so

That will create a link called libnpjp2.so which will be in your current directory and point to /opt/jre1.7.0_55/lib/amd64/libnpjp2.so. I very much doubt that's what you want to do but that's what you seem to be asking for.

If for whatever reason the commands above don't work. please edit your question and tell us precisely how they failed. A simple "did not work" is not very useful. Were there any error messages? Is a broken link created? What went wrong?

  • 1
    There are reasons to run sudo ln, namely when you want to create a link in a directory you do not have write permissions for. Permissions for creating (or deleting) files depend entirely on the permissions of the parent directory. That being said, It looks like the entire post should be a comment.
    – Adaephon
    May 23, 2014 at 8:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .