# How to run java old version program in newer version 1.6



## kshitizsingh (Jul 21, 2011)

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 (Jul 22, 2011)

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.


```
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.


----------



## kshitizsingh (Jul 26, 2011)

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.


----------

