Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

After downloading jdk-7u45-linux-x64.tar.gz and moving it to my own folder ~/java, I followed their steps here: http://docs.oracle.com/javase/7/docs/webnotes/install/linux/linux-jdk.html

I apparently only extracted the contents of the file, because when I ran this command:

% tar zxvf jdk-7u45-linux-x64.tar.gz

It said that it couldn't find the % command, so I removed % and ran it, then when I typed java, it output to me what it did when I first installed Ubuntu. What am I doing wrong?

share|improve this question

marked as duplicate by bain, Alaa Ali, Luis Alvarado Aug 4 at 22:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Did you try this: askubuntu.com/questions/56104/… –  i08in Dec 17 '13 at 3:47

4 Answers 4

Here are detailed instructions that I generally agree with. You can skip Step 6.

How to Install Oracle Java JDK on Ubuntu Linux

share|improve this answer

The command sudo apt-get install openjdk-7-jdk should do the job. If there is a dependency problem run sudo apt-get -f install and rerun the earlier command.

share|improve this answer

Try this step by step and it will work: http://www.wikihow.com/Install-Oracle-Java-JDK-on-Ubuntu-Linux Good luck

share|improve this answer

The actual command is "tar zxvf jdk-7u45-linux-x64.tar.gz", without "%". But that will only extract the JDK archive and won't install it.

It's a bit tricky to install JDK properly manually but you can easily do it by using an automated installer - all you have to do to download and install the latest Oracle JDK 7 is to use the commands below:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

More info: Install Oracle Java 7 in Ubuntu via PPA Repository

share|improve this answer

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