Is there an option to build java code to run on JRE 1.5 when compiled using JDK 1.6?
PS: I am new to Java.
If you compile your code with 1.6 then it will not run on 1.5. If you want it to run in 1.5 then you can compile the code with 1.5 and it would be able to run on both.
Try compiling with 1.5 and if there are errors then post them. The only way it will not compile on 1.5 is if you use specific 1.6 enhancements in your code.
To answer the real question.
javac -target 1.5
See here for more details.