Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

can anybody help me in solving this issue. I am new to Linux and here's problem:

gourab@gourab-RV509:/usr/share/java$ cd /
gourab@gourab-RV509:/$ cd usr
gourab@gourab-RV509:/usr$ mkdir JAVA
mkdir: cannot create directory `JAVA': Permission denied
share|improve this question
up vote 4 down vote accepted

Instead of mkdir JAVA use sudo mkdir JAVA, then enter your password.

That should fix it.

However, you only really need to use one command instead of these two or three.

cd / 
cd usr 
sudo mkdir JAVA 

cd just changes the directory, no point in doing that. You can simply put the path of the file after mkdir, like so.

sudo mkdir /usr/JAVA
share|improve this answer
Thanks for supporting !! worked 100% fine – grv.giit Jan 1 '13 at 15:10
@grv.giit You can also use sudo -i to elevate to root, then do all future commands(until you close the terminal) without the sudo. – hexafraction Jan 1 '13 at 15:40
@ObsessiveSSOℲ: thanks got it this will solve my problem – grv.giit Jan 1 '13 at 15:54

Permission denied means you have to be a superuser or root to create files/folder on a specific directory. So to create folder that needs a root permission, you need to simply add sudo before your command: sudo mkdir -p JAVA

share|improve this answer
worked perfectly for me . Thanks for support !! :) – grv.giit Jan 1 '13 at 15:09

In order to create a directory in any folder other than /home/username, where username is your account's username, you need to prepend mkdir with sudo, so create the folder like this:
sudo mkdir JAVA

share|improve this answer
Thanks friend . This really worked for me !! :) – grv.giit Jan 1 '13 at 15:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.