DIGIT-ARC read-only archive · snapshot: July 23, 2026

How to run java old version program in newer version 1.6

3 posts · originally from https://geek.digit.in/community/threads/how-to-run-java-old-version-program-in-newer-version-1-6.144105/

K
kshitizsingh Original post #1
Jul 21, 2011 at 5:31 PM
hello frds....i wanted to help in java newer version 1.6 software....i was using version 1.4 and my project and my other java program working fine....now i upgraded to newer version....now all the files are not compiling and running in the newer version....can any body help me on this problem...that how can i run my old version java program in newer one.


Thanks in Advance
Garbage
Garbage #2
Jul 22, 2011 at 2:46 PM
It would be great if you can provide more specific error like, what is the error you are getting while running / compiling the program, etc.

I am assuming you want to compile your .java files compatible to older versions. You can use "-source" switch of javac for that.

Code:
javac -source 1.4 MyProgam.java
Above line will treat MyProgram.java as Java 1.4 compatible source and will produce binary which is compatible with JRE 1.4

I hope this helps.
K
Jul 26, 2011 at 8:02 PM
Hi ....I attached the file in which I pasted the errors,when i trying to run my files in newer version of java 1.6. These files was running successfully in java version 1.4.