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.

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
    
Did you try this: askubuntu.com/questions/56104/… –  i08in Dec 17 '13 at 3:47
add comment

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
add comment

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
add comment

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
add comment

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
add comment

Your Answer

 
discard

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.