• Post Reply Bookmark Topic Watch Topic
  • New Topic

Compiling source code in lower java version  RSS feed

 
ravi kanth
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Can you help me in solving this problem.
I am having java source file written in jdk1.4
Now i need to compile in jdk 1.3.

Can you help to solve this.

Thanks,
raja.
 
Marco Ehrentreich
best scout
Bartender
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ravi,

if you're using the command line you can use the following parameters for "javac":

-source 1.3 if you want to force source code compatibility with Java version 1.3
-target 1.3 if you want to compile your code for a JVM in version 1.3

Otherwise your favourite IDE will have some kind of flag to set this option.

Marco
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... of course, if the code uses features that were introduced in the Java 1.4 API (like NIO, Preferences, SringLayout, JSpinner, regexps etc.) then there's no way to compile and run it on Java 1.3.
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And why on earth do you want to use a version of Java which was obsolete 8 years ago?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!