Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

How can you compile a java program in all the previous versions of java using a single version?

user-image
Question ajoutée par himanshu mittal
Date de publication: 2013/06/26

it depends on the JVM version, for example: a1.4 JVM won't run a .java file compiled by a1.6 compiler unless you use compilation flags as follows: in you console you can try this % javac -target1.4 -bootclasspath jdk1.4.2/lib/classes.zip \ -extdirs "" OldCode.java -target : tells the used compiler to generate code that will run on an older JVM.
-bootclasspath : compile your code against the APIs of the older version of Java.
for more information of using 'javac' command, see it's documentation on http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/javac.html

Amitesh Rai
par Amitesh Rai , SOFTWARE DEVELOPER , techzone technology pvt ltd

javac -source jdk_version programName.java

More Questions Like This

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?