I am trying to compile my code and run it on a different server. The problem is my JRE version is Java version "1.6.0_13" and that on the server is Java version "1.4.2".
This gives me "unrecognized class file version" exception when I try to run the jar on the server. I cannot compile my code on the server because of various dependencies I will have to set up.
So I need to know if there is a way to "use Eclipse" [this is easier than command line since it takes care of dependencies] and compile my stuff using 1.4.2 instead 1.6.0_13. Do I have to uninstall my JRE from my machine, then reinstall previous version and then compile or is there an elegant and cleaner way?
You should install 1.4.2 along side 1.6 on your machine, and configure that eclipse project to use the 1.4.2 JDK. Other projects may be configured to use the 1.6.
Technically you can compile to 1.4.2 compatibility with JDK 1.6, but odds are you will run into library problems, so it is not generally worth doing.