NEW(er) UPDATE:
Well I've finished making the script for Java 7 installation. It should work for all Java 7 updates (unless Oracle happens to change their naming format for the archives).
Take time and READ THIS POST, or you might end up having trouble.
==================Average home pc users, read below==========================
Made a script to automate installation of Java. It is uploaded onto MediaFire. All you need to do is:
1. Download the latest Java (for Linux of course) from here:
http://java.com/en/download/linux_manual.jsp?locale=en
2. Make sure you put the downloaded tar.gz archive in your home folder
3. EXTRACT the tar.gz archive and make SURE it's in the home folder (right click on the archive > "Extract here")
4. Download ONE of these scripts below (according to 32 or 64 bit). You can check your OS architecture by menu> terminal > "arch"
If it says i686, you would want the 32-bit script. If it says x86_64, you would want the 64-bit script
32-bit users, use this script: [work in progress]
64-bit users, use this script: [work in progress]
5. Now that you have the required items in your home folder, go ahead and open up a terminal
6. Type in "sh java32.sh" if you're on a 32-bit OS; type in "sh java64.sh" if you're on a 64-bit OS. Hit enter and you're set.
NOTE: For Java updates 1-9, please use 01,02,03...09 when prompted. (Again stated inside the script and when you run it).
NOTE2: You can ALWAYS check what stuff is contained within a shell script. You just open it up with a text editor like Leafpad or Gedit for example.
NOTE3: You may get a few minor errors such as: "mkdir: cannot create directory `java': File exists" "mkdir: cannot create directory `32' ('64'): File exists"
Or if the icedtea plugin isn't installed, you will get a "icedtea not installed so not removed" output. Ignore these (I have to add file checking to my script).
If you reach the line that says "If the output below matches the version that you installed, all is well", and you notice that
the Java has been upgraded, that is all that matters.
===================================================
===========REMOVAL OF PREVIOUS VERSIONS============
To remove previous versions of Java (thereby saving ~100MB disk space for each version removed), you can simply remove that version by opening your file manager as root and going into /opt/java/{32,64}/ and removing the previous versions. So what you do is, open a run dialog by pressing Alt+F2, then type in "gksu thunar/pcmanfm/nautilus" <--choose your default file manager. Then follow what I said above. So lets say you have Java 7 update 5 (latest at the time I am writing this) and you also have Java 7 update 4 (older), you can delete that folder that says Java7u4.
==========================================================================
====================Geeks (or geeks in training), read below====================
If you want to, you can improve this script, but I would like it if you would paste the improvements on this page so that I can try it out before adding it to my current one.
And of course, credit will be given
Further improvement: at the moment, I am stuck at extracting from the shell script. What I would like is to extract using a wildcard (ex: tar xzvf jre-7u*.tar.gz) but this doesn't work when I try it INSIDE the script. If I try it in the terminal however, it works. I would like if someone would give a solution and post up an update to the script
)
==========================================================================
THE STUFF BELOW IS WHAT IS CONTAINED INSIDE THE 32-BIT SCRIPT. You can check it yourself by right clicking > open with > gedit or leafpad or abiword , etc
Code: Select all
work in progress. should be done by a week.
THE STUFF BELOW IS WHAT IS CONTAINED INSIDE THE 64-BIT SCRIPT. You can check it yourself by right clicking > open with > gedit or leafpad or abiword , etc
Code: Select all
work in progress. should be done by a week.