Thursday, 15 May 2014

How to compile java 1.3 code with gradle? -



How to compile java 1.3 code with gradle? -

i need compile rather old project uses java language level 1.3. language level 1.3 must used, since classes utilize default bundle , importing classes default bundle isn't allowed on higher language levels.

i able compile project changing language level 1.3 in eclipse configuration, have problem using gradle. added sourcecompatibility , targetcompatibility build.gradle file:

compilejava { sourcecompatibility = 1.3 targetcompatibility = 1.3 }

which produces next warnings:

warning: [options] bootstrap class path not set in conjunction -source 1.3 warning: [options] source value 1.3 obsolete , removed in future release warning: [options] target value 1.3 obsolete , removed in future release

but compiling fails pointing me import statements:

...\src\foo.java: 10: error: '.' expected import bar;

my question is: how compile java 1.3 code using gradle without changing code?

gradle -v:

groovy: 1.8.6 ant: apache ant(tm) version 1.9.3 compiled on dec 23 2013 ivy: 2.2.0 jvm: 1.8.0_05 (oracle corporation 25.5-b02) os: windows 7 6.1 amd64

the error message misleading. sourcecompatibility indeed configured right, bar wasn't found, because of missing dependency. bad.

java gradle

No comments:

Post a Comment