1

I've got a project written using JDK 1.4.1 an JDK 1.7 installed on my machine. I can build those 1.4-sources with the line:

javac @sources.txt -source 1.4 -target 1.4 -deprecation -classpath %cp% -Xstdout log.txt -d .\classes

Is it possible to run it with -source 1.4 -target 1.7 combination?


Also I'm curious will there be any performace gain if I run application written with JDK 1.4.1 on the system where JDK 1.7.1 is installed?

lexeme
  • 2,840
  • 10
  • 57
  • 120
  • Have you read http://stackoverflow.com/questions/10663450/whats-the-difference-between-source-and-target-compatibility ? – D.R. Mar 14 '13 at 12:41
  • Ok, so I can use `-source 1.4 -target 1.7`. Will this work faster on JDK 7 than on JDK 1.4? – lexeme Mar 14 '13 at 13:09
  • Depends on your source code, I guess ;-) I don't think so, however, there are other reasons why one wouldn't want to do that, see: http://stackoverflow.com/questions/8983310/jdk-jre-an-jars-compatibility – D.R. Mar 14 '13 at 13:12
  • I'm appreciated for your useful input. Form it as a question and I'll accept it. – lexeme Mar 14 '13 at 13:15

1 Answers1

1

It is possible, however, I don't think you are winning performance by doing so. Furthermore there are reasons why you do NOT want to do this, see JDK, JRE an JARs compatibility

Community
  • 1
  • 1
D.R.
  • 18,900
  • 20
  • 82
  • 181