ANT build file for the Quickstart example
Paul Sandoz
paul.sandoz at oracle.com
Thu Jul 12 08:00:25 PDT 2012
Hi Deepak,
The error indicates you are not using a version of OpenJDK Jigsaw to compile. See the "executable" attribute of the javac task.
However, there is a more fundamental issue using the javac ant task since it knows nothing about the new javac command line options. Thus it will likely confuse OpenJDK Jigsaw javac by including the "-classpath" option in addition to the '-modulepath" option explicitly added (which needs to be <compilerarg line="-modulepath modules" />)
This is why i have been using special ant macros until the ant tasks are modified.
See the examples, that are ant-based, linked from:
http://earthly-powers.blogspot.co.uk/2012/06/modular-services-with-openjdk-jigsaw.html
http://earthly-powers.blogspot.co.uk/2012/07/modular-services-with-openjdk-jigsaw.html
https://github.com/PaulSandoz/openjdk-jigsaw-examples/
Paul.
On Jul 12, 2012, at 3:54 PM, Deepak S Patwardhan wrote:
> Hello,
>
>
>
> Has anyone written an ANT build file for the Quick start example on Project
> jigsaw's homepage ?
>
>
>
> Since current Maven is pretty much unusable for Jigsaw projects (right?), I
> tried to create an ANT build.xml with the intention to define targets like
>
>
>
> compile - compile the code.
>
> dist - prepare the jmod files using jpkg.
>
> install - install the jmod files into project's module library using jmod.
>
>
>
> But, I can't get the compile to happen successfully. This is what I tried :
> (target init creates the modules/ folder)
>
>
>
> <target name="compile" depends="init">
>
> <javac srcdir="src" sourcepath="src/classes" destdir="modules"
> fork="yes" includeantruntime="no">
>
> <compilerarg value="-modulepath modules" />
>
> </javac>
>
> </target>
>
>
>
> The build fails with this message :
>
>
>
> compile:
>
> [javac] Compiling 5 source files to
> /home/deepak/Projects/kingdom/kssjava8/jigsaw/modules
>
> [javac] javac: invalid flag: -modulepath modules
>
> [javac] Usage: javac <options> <source files>
>
> [javac] use -help for a list of possible options
>
>
>
> Any suggestions ?
>
>
>
> Regards,
>
> Deepak S Patwardhan.
>
>
>
More information about the jigsaw-dev
mailing list