- How to install an older version of Java
- 2 Answers 2
- Java Archive
- The Oracle Java Archive offers self-service download access to some of our historical Java releases
- Previous Java releases
- Java SE
- Java Language Java Compiler — ‘javac’ Compiling for a different version of Java
- Compiling old Java with a newer compiler
- Compiling for an older execution platform
- Customer Support
- How to Downgrade Java Version (Windows User) Print
How to install an older version of Java
I updated my installation of the sun-java6-jdk package today to version 6.24-1build0.10.10.1 after being prompted by the update manager. However this now causes some compilation failures so I’d like to revert back to the previous version that I had installed. I’ve tried using Synaptic but the ‘Force Version’ menu command is disabled. I’ve tried the following command to install the previous version sudo apt-get install sun-java6-jdk=6.22-0ubuntu1~10.10 But I’m not sure that I have the correct version:
Reading package lists. Done Building dependency tree Reading state information. Done E: Version ‘6.22-0ubuntu1~10.10’ for ‘sun-java6-jdk’ was not found
I’ve taken this version number from this changelog: https://launchpad.net/ubuntu/+source/sun-java6/+changelog Is this the correct way to install a previous version of a package? Have I got the correct version from the sun-java6 change log?
2 Answers 2
It’s the correct way to downgrade a package, but you seem to have got the version number wrong.
apt-get install sun-java6-jdk=6.22-0ubuntu1~10.10 — won’t work since there is no such package in the Package.gz list, that’s why you got the error: Version ‘6.22-0ubuntu1~10.10’ for ‘sun-java6-jdk’ was not found.
Try this. dpkg -r sun-java6-jdk — Removes the sun-java6-jdk
Download the .deb for your previous sun-java6-jdk version, you may already have this file in /var/cache/apt/archives — use: $ ls /var/cache/apt/archives/sun* -lash in your terminal to find out whether you have an older version locally.
apt-get install -d sun-java-jdk / openjdk-6-jdk — the -d will only download the file into your /var/cache/apt/arhives folder.
dpkg -i —force-downgrade /var/cache/apt/archives/sun-java-jdk (the version # that you have).
Lock Version in Synaptic so ubuntu doesn’t try to upgrade it again. Dpkg man page will also help explain things — downgrade has a big warning label on it in the man pages, so take note you don’t wreck your dependencies. There is a post here and here that explains downgrading.
Java Archive
The Oracle Java Archive offers self-service download access to some of our historical Java releases
WARNING: These older versions of the JRE and JDK are provided to help developers debug issues in older systems. They are not updated with the latest security patches and are not recommended for use in production.
For production use Oracle recommends downloading the latest JDK and JRE versions and allowing auto-update.
Only developers and enterprise administrators should download these releases.
Downloading these releases requires an oracle.com account. If you don’t have an oracle.com account you can create one here.
For current Java releases, please visit Oracle Java SE Downloads.
Current update releases for JDK 7 is available for support customers.
For more information on the transition of products from the legacy Sun download system to the Oracle Technology Network, visit the SDLC Decommission page announcement.
Previous Java releases
Java SE
Java Client Technologies
Java 3D, Java Access Bridge, Java Accessibility, Java Advanced Imaging, Java Internationalization and Localization Toolkit, Java Look and Feel, Java Media Framework (JMF), Java Web Start (JAWS), JIMI SDK
Java Platform Technologies
Java Authentication and Authorization Service (JAAS), JavaBeans, Java Management Extension (JMX), Java Naming and Directory Interface, RMI over IIOP, Java Cryptography Extension (JCE), Java Secure Socket Extension
Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files
The Java Cryptography Extension enables applications to use stronger versions of cryptographic algorithms. JDK 9 and later offer the stronger cryptographic algorithms by default.
The unlimited policy files are required only for JDK 8, 7, and 6 updates earlier than 8u161, 7u171, and 6u181. On those versions and later, the stronger cryptographic algorithms are available by default.
Java Database
Java DB Connectivity (JDBC), Java Data Objects (JDO)
Misc. tools and libraries
JDK Demos and Samples, Sample Code for GSSAPI/Kerberos, Java Communications API
Java SE downloads
- Java SE 20
- Java SE 19
- Java SE 18
- Java SE 17
- Java SE 16
- Java SE 15
- Java SE 14
- Java SE 13
- Java SE 12
- Java SE 11
- Java SE 10
- Java SE 9
- Java SE 8 (8u211 and later)
- Java SE 8 (8u202 and earlier)
- Java SE 7
- Java SE 6
- Java SE 5
- Java SE 1.4
- Java SE 1.3
- Java SE 1.2
- Java SE 1.1
- JRockit Family
- Java SE Tutorials
- JDK 1.3 Documentation
- JDK 1.4.2 Documentation
Java Language Java Compiler — ‘javac’ Compiling for a different version of Java
The Java programming language (and its runtime) has undergone numerous changes since its release since its initial public release. These changes include:
- Changes in the Java programming language syntax and semantics
- Changes in the APIs provided by the Java standard class libraries.
- Changes in the Java (bytecode) instruction set and classfile format.
With very few exceptions (for example the enum keyword, changes to some «internal» classes, etc), these changes are backwards compatible.
- A Java program that was compiled using an older version of the Java toolchain will run on a newer version Java platform without recompilation.
- A Java program that was written in an older version of Java will compile successfully with a new Java compiler.
Compiling old Java with a newer compiler
If you need to (re-)compile older Java code on a newer Java platform to run on the newer platform, you generally don’t need to give any special compilation flags. In a few cases (e.g. if you had used enum as an identifier) you could use the -source option to disable the new syntax. For example, given the following class:
the following is required to compile the class using a Java 5 compiler (or later):
$ javac -source 1.4 OldSyntax.java
Compiling for an older execution platform
If you need to compile Java to run on an older Java platforms, the simplest approach is to install a JDK for the oldest version you need to support, and use that JDK’s compiler in your builds.
You can also compile with a newer Java compiler, but there are complicated. First of all, there some important preconditions that must be satisfied:
- The code you are compiling must not use Java language constructs that were not available in the version of Java that you are targeting.
- The code must not depend on standard Java classes, fields, methods and so on that were not available in the older platforms.
- Third party libraries that the code depends must also be built for the older platform and available at compile-time and run-time.
Given the preconditions are met, you can recompile code for an older platform using the -target option. For example,
$ javac -target 1.4 SomeClass.java
will compile the above class to produce bytecodes that are compatible with Java 1.4 or later JVM. (In fact, the -source option implies a compatible -target , so javac -source 1.4 . would have the same effect. The relationship between -source and -target is described in the Oracle documentation.)
Having said that, if you simply use -target or -source , you will still be compiling against the standard class libraries provided by the compiler’s JDK. If you are not careful, you can end up with classes with the correct bytecode version, but with dependencies on APIs that are not available. The solution is to use the -bootclasspath option. For example:
$ javac -target 1.4 --bootclasspath path/to/java1.4/rt.jar SomeClass.java
will compile against an alternative set of runtime libraries. If the class being compiled has (accidental) dependencies on newer libraries, this will give you compilation errors.
PDF — Download Java Language for free
Customer Support
How to Downgrade Java Version (Windows User) Print
Modified on: Wed, 19 Sep, 2018 at 8:26 AM
With upcoming changes to Java it may be necessary to revert back to an older version in order to continue using the streamer’s Web Start Installer without issue. In order to complete this task the first step will be to remove your current Java version, then follow our link to download an older version. The steps below will outline this:
— Click your Windows Icon (bottom left on your screen) to open the Start Menu, depending on your Windows version the Control Panel will be in a different place. The images below show how you can search within Windows 10, and also the location within Windows 7.
— Within Control Panel, select Install/Uninstall a Program
— You can choose to order this list alphabetically by clicking the Name Bar. Locate Java on this list and select Uninstall (Note: You may have multiple versions, if so, please contact our Support Department for assistance on which version to remove)
— The following window (or something similar) should appear, proceed by clicking Yes to remove Java. Please disregard the version number below, these images are for example purposes only.
— Windows should then being the Uninstall Process. You will see a window with a green bar appear, similar to below:
— Check your Program Files folder and ensure that Java is no longer present, you will notice Java is no longer present within the Uninstall or Change a program list from one of our previous steps (Start Menu > Computer ? (C:) Drive > Program Files)
— Following this link to Java 8u172 and select the Java SE Runtime Environment 8u172 (Note: x86 = 32-bit), we find that this works best with the Web Start Installer for the streamer. You will need to click Accept License Agreement (shown below in red)
— You may need to create an Oracle Account, this is a relatively short and simple process.
— An .exe (Executable) file will be downloaded, you will need to locate and open this file. If you use Google Chrome, the downloads bar is along the bottom of the Web Browser, Mozilla Firefox downloads are along the to the right hand side of the screen (see image). Click on the file to open
— This warning may appear, please click Run
— The Download should now begin, the following Window will appear and the green bar will start to load
— Java 8u172 is now installed on your Computer, you can confirm this on the Java Control Panel. Search: Java > Configure Java > General > About
— If you have any queries or run into any difficulty please contact our Support Department on 1877-367-5970 on via email [email protected]
Did you find it helpful? Yes No