Wednesday 15 May 2013

javac - How to force Java 8 wsimport command-line to generate 1.6 target compatible code -



javac - How to force Java 8 wsimport command-line to generate 1.6 target compatible code -

i'm trying upgrade existing build scheme utilize java 8 instead of java 5/6 compiler, however, still have generate outputs compatible java 5/6. overall trivial (-target 1.6), having difficulty doing code generated wsimport (using version in jdk 8 bin).

i'm using java hotspot 64-bit server vm (build 25.20-b23), jdk 1.8.0_20.

the wsimport command beingness called command-line generate code , outputs packaged straight there. legacy reasons unable alter process (such utilize ant), need solve problem command-line.

what run is: "wsimport wsdl_file" (actual file doesn't matter) run "javap -verbose class | grep major" on of classes in output check version: comes out 52.

i've tried using -j argument wsimport pass options javac compiler, none of below have worked:

wsimport "-j-target 1.6" wsdl (fails unrecognized alternative -target 1.6" coming wsimport) wsimport "-j-djavac.target=1.6" wsdl (no effect) wsimport "-j-djavac.opt.target=1.6" wsdl (no effect)

presumably there's either variation on passing target through works or property settings should work; if it's 1 i'm using, haven't figured out how pass correctly.

assuming wsimport creates java 6 compatible source code, no reason shouldn't, knows, solution add together -xnocompile wsimport, , build source straight yourself, using whatever mechanism comfortable process.

java javac wsimport

No comments:

Post a Comment