How to install oracle java 7 in ubuntu 13.04/12.10/12.04
Java is a programming language and computing platform first released by Sun Microsystems in 1995. It is the underlying technology that powers state-of-the-art programs including utilities, games, and business applications. Java runs on more than 850 million personal computers worldwide, and on billions of devices worldwide, including mobile and TV devices.
Preparing your system
First you need to remove openjdk for this run the following command from your terminal
sudo apt-get purge openjdk*
If you installed java 7 from any other PPA and you are having problem with java then you have to do following steps before installing the PPA menctioned here
sudo rm /var/lib/dpkg/info/oracle-java7-installer*
sudo apt-get purge oracle-java7-installer*
sudo rm /etc/apt/sources.list.d/*java*
sudo apt-get update
Install oracle java 7 in ubuntu 13.04/12.10/12.04
Open the terminal and run the following commands
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
You can check the java version by searching java in dashboard
I had a problem with this. I was getting
sha256sum mismatch jdk-7u3-linux-x64.tar.gz
I checked the file in
/var/cache/oracle-java7-installer
and it looked like it was invalid
I was able to fix it by directly downloading the file from oracle, putting it in the cache directory and then editing
/var/lib/dpkg/info/oracle-java7-installer.postinst
and bypassing ths download and sha check
This problem just started happening today, I used the package successfully yesterday on a different computer
The problem is that the java download package is malformed and only contains an Unauthorized Download message and info.
It seems Oracle prevents direct downloads
Thanks – that solved the problem for me too – just had to put the jdk-7u3-linux-x64.tar.gz file into /var/cache/oracle-java7-installer/ and then comment out the code between ‘echo “Downloading…”‘
and ‘echo “Download done”‘ in the /var/lib/dpkg/info/oracle-java7-installer.postinst script.
how can i do that??
Use a text editor to open the file and put a “#” at the start of each line between ‘echo “Downloading…”‘
and ‘echo “Download done” in the file, then save it.
I had this problem too!
?????: “./jdk-7u3-linux-x64.tar.gz”
0K ..... 100% 574M=0s
2012-04-10 11:23:56 (574 MB/s) - ??? “./jdk-7u3-linux-x64.tar.gz” [5307/5307])
Download done.
sha256sum mismatch jdk-7u3-linux-x64.tar.gz
Oracle JDK 7 is NOT installed.
dpkg??? oracle-java7-installer (--configure)????
??? ??? post-installation ?? ?????? 1
??????????
oracle-java7-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)
Pls help. I am facing the same problem here. I am not able to install any version of java, and my entire work has stopped because of this! 🙁 I am on Natty!
Hi Anthony, i make that change, it’s pass, and i need to comment the code for a “verify SHA256 checksum” but now a get this error:
mv: impossível obter estado de “jdk1.7.0_03”: Arquivo ou diretório não encontrado
dpkg: erro processando oracle-java7-installer (–configure):
sub-processo script post-installation instalado retornou estado de saída de erro 1
E: Sub-process /usr/bin/dpkg returned an error code (1)
Do you now how can i fix this?
I don’t speak spanish – can you translate that for me?
Also, I don’t know why you need to comment the code for verifying the SHA256 checksum… why are you doing that?
I found this and worked:
OK figured out how to install.
Download tar.gz from here: http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u3-download-1501626.html
and place it to: var/cache/oracle-java7-installer
then open with text editor: var/lib/dpkg/info/oracle-java7-installer.postinst
and place # (or delete) in beginning of these lines: 74-107, 111-116
and then run again sudo apt-get purge openjdk*
try my answer above.
Anthony,
i need to comment the SHA256 checksum because give me a error and stop.
Here:
mv: can not get status “jdk1.7.0_03”: File or directory not found
dpkg: error processing oracle-java7-installer (- configure):
subprocess post-installation script returned error exit status 1
E: Sub-process / usr / bin / dpkg returned an error code (1)
falzer the error continue..
I had already tested this, yesterday, but doesn’t work.
maybe you commented something in post-installation that was not to be commented. have u tried it from beggining?
After installing repo I just install it from synaptic… 😉
It works.
I use this tuto to install and its works:
http://www.liberiangeek.net/2012/04/install-oracle-java-jdk-7-in-ubuntu-12-04-precise-pangolin/
$ cp /usr/lib/jni/libswt-*3740.so ~/.swt/lib/linux/x86
Hi…
After some errors and testing, i found out that following the proposal of falzer is the best solution.
Thanks for that falzer.
I followed falzer’s solution and still, I got this:
Download done.
sha256sum mismatch jdk-7u3-linux-x64.tar.gz
Oracle JDK 7 is NOT installed.
dpkg: error processing oracle-java7-installer (–configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of oracle-jdk7-installer:
oracle-jdk7-installer depends on oracle-java7-installer; however:
Package oracle-java7-installer is not configured yet.
dpkg: error processing oracle-jdk7-installer (–configure):
dependency problems – leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
that basically means that the checksum in the install script did not match,
you may have downloaded jre 7u4 instead of 7u3
This is what works for me
sudo rm /var/lib/dpkg/info/oracle-java7-installer*
sudo apt-get purge oracle-java7-installer*
sudo rm /etc/apt/sources.list.d/*java*
sudo apt-get update
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
Thanks to cga. That works for me too!
Thanks, that saved me a lot of time!!
Worked for me aswell! Thank you
Thanks a Lot, this was what works for me …
Nope, no workie:
[email protected]:~$ sudo apt-get install oracle-java7-installer
Reading package lists… Done
Building dependency tree
Reading state information… Done
oracle-java7-installer is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up oracle-java7-installer (7u4-0~webupd8~4) …
Removing outdated cached downloads…
Downloading cookie…
–2012-06-12 02:48:22– http://launchpadlibrarian.net/98645053/cookie.txt
Resolving iam.wayward4now.net (iam.wayward4now.net)… 192.168.0.2
Connecting to iam.wayward4now.net (iam.wayward4now.net)|192.168.0.2|:3142… connected.
Proxy request sent, awaiting response… 403 Forbidden file type or location: http://launchpadlibrarian.net/98645053/cookie.txt
2012-06-12 02:48:22 ERROR 403: Forbidden file type or location: http://launchpadlibrarian.net/98645053/cookie.txt.
download failed
Oracle JDK 7 is NOT installed.
dpkg: error processing oracle-java7-installer (–configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
oracle-java7-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)
[email protected]:~$
p/s this was my second attempt after following all the instructions to remove all traces of a previous install.
@cga: you are a genius, thank you
Thanks Cga works very well !!, it installed very well, in firefox and google chrome !
Hey ubuntu geek website, please can you add cga response to your post in update, I’m sure it’ll help lots of people !! 🙂
As @poltiser said:
Add the repository and update repositories.
Then, open Synaptic and install Oracle Java.
Done.
Or go to this page http://www.duinsoft.nl/packages.php?t=en