You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by lo...@lsd.di.uminho.pt on 2006/09/12 01:08:43 UTC

[m2] native code compilation (javac, javah and gcc)

Hello all,
  I am trying to build native classes with maven2 but there is an issue when
calling javah.

  The things should happen in the following order:

    i) Build the java source classes that have calls to JNI.
   ii) Dump the class files into target/classes
  iii) Using the "native-maven-plugin" call "javah" to generate the header
files. This needs the just compiled classes in target/classes in the
classpath
   iv) Compile the C source files and create the library.

The problem is that the compiled classes are not available in the classpath
when javah is called. Is there a way to do this using only the
native-maven-plugin?

Particularly, how can I change the classpath when runnig the
native-maven-plugin so that the javah gets called with -classpath
${maven.dependency.classpath}:${project.build.directory}/classes ?

Thanks.

-- 
Luís Soares


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] native code compilation (javac, javah and gcc)

Posted by lo...@lsd.di.uminho.pt.
Oopss!! Sorry, my mistake. BTW, thanks for the quick reply.

> why are you sending the same message within 10mins? ;-)
>
> On 9/11/06, los@lsd.di.uminho.pt <lo...@lsd.di.uminho.pt> wrote:
>>
>> Hello all,
>> I am trying to build native classes with maven2 but there is an issue
>> when
>> calling javah.
>>
>> The things should happen in the following order:
>>
>>    i) Build the java source classes that have calls to JNI.
>>   ii) Dump the class files into target/classes
>> iii) Using the "native-maven-plugin" call "javah" to generate the header
>> files. This needs the just compiled classes in target/classes in the
>> classpath
>>   iv) Compile the C source files and create the library.
>>
>> The problem is that the compiled classes are not available in the
>> classpath
>> when javah is called. Is there a way to do this using only the
>> native-maven-plugin?
>>
>> Particularly, how can I change the classpath when runnig the
>> native-maven-plugin so that the javah gets called with -classpath
>> ${maven.dependency.classpath}:${project.build.directory}/classes ?
>>
>> Thanks.
>>
>> --
>> Luís Soares
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] native code compilation (javac, javah and gcc)

Posted by dan tran <da...@gmail.com>.
why are you sending the same message within 10mins? ;-)

On 9/11/06, los@lsd.di.uminho.pt <lo...@lsd.di.uminho.pt> wrote:
>
> Hello all,
> I am trying to build native classes with maven2 but there is an issue when
> calling javah.
>
> The things should happen in the following order:
>
>    i) Build the java source classes that have calls to JNI.
>   ii) Dump the class files into target/classes
> iii) Using the "native-maven-plugin" call "javah" to generate the header
> files. This needs the just compiled classes in target/classes in the
> classpath
>   iv) Compile the C source files and create the library.
>
> The problem is that the compiled classes are not available in the
> classpath
> when javah is called. Is there a way to do this using only the
> native-maven-plugin?
>
> Particularly, how can I change the classpath when runnig the
> native-maven-plugin so that the javah gets called with -classpath
> ${maven.dependency.classpath}:${project.build.directory}/classes ?
>
> Thanks.
>
> --
> Luís Soares
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>