I want to install JAVA, but the installation instructions ask me to create a new folder, called /java/
, into the standard /usr/
folder.
But this folder is blocked. I mean, I can not to create a new folder on it, with the PCManFM file manager, because that option is grey.
So I guess there should be a command to create it from a Terminal session. (With sudo
, maybe?)
How can I get it? Which is the right command to get it?
Create the folder from a command line terminal using:
You need
sudo
to make changes to/usr
because/usr
is owned by theroot
user.I'm going to address two parts of your question: java installation and folder creation.
Java installation
We already have a question about that: How can I install Sun/Oracle's proprietary Java JDK 6/7/8 or JRE?.All of the necessary commands are there, and I strongly suggest you read their manual pages with
man COMMAND
in terminal.There's also open-source version of Java, Open JDK. Installation of that is somewhat simpler
That's pretty much it - apt-get will take care of everything. When you install some package with
apt-get
ordpkg
there should be preinstall and postinstall scripts that come along with the package, and run automatically to set up whatever program you're getting.Folder Creation
Folder ( in linux terminology - directory ) creation, just like file creation, depends on the permissions. If a folder has the following permissions,
that means the owner of that folder
testuser
can read-write-execute stuff there (firstrwx
), and grouptestuser
can only read and execute stuff there - that's ther-x
part, and finalr-x
part means read execute for any other groups or users./usr
folder is owned by root user, so only root can write there, that means create files or folder. Hence for that you needsudo
to gain root privileges temporarily.You have a few choices:
gksudo pcmanfm
will request you enter your password, then open PCManFM as root, which is somewhat dangerous because if you are not careful you may unintentionally modify system files.sudo mkdir /usr/java
will create the directory directly.