From a1d36351fdbb686f7277d90dd7f58b6cab1e453a Mon Sep 17 00:00:00 2001 From: Mark Donszelmann Date: Sat, 17 Oct 2009 22:53:49 +0200 Subject: Fixed NAR-25 --- src/main/java/org/apache/maven/plugin/nar/Javah.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/org/apache/maven/plugin/nar/Javah.java b/src/main/java/org/apache/maven/plugin/nar/Javah.java index 33e6b1c..f297416 100644 --- a/src/main/java/org/apache/maven/plugin/nar/Javah.java +++ b/src/main/java/org/apache/maven/plugin/nar/Javah.java @@ -234,11 +234,14 @@ public class Javah getJniDirectory().mkdirs(); getTimestampDirectory().mkdirs(); - mojo.getLog().info( "Running " + name + " compiler on " + files.size() + " classes..." ); - int result = NarUtil.runCommand( name, generateArgs( files ), null, null, mojo.getLog() ); + File javahFile = new File( mojo.getJavaHome( mojo.getAOL() ), "bin" ); + String javah = new File(javahFile, name).getAbsolutePath(); + + mojo.getLog().info( "Running " + javah + " compiler on " + files.size() + " classes..." ); + int result = NarUtil.runCommand( javah, generateArgs( files ), null, null, mojo.getLog() ); if ( result != 0 ) { - throw new MojoFailureException( name + " failed with exit code " + result + " 0x" + throw new MojoFailureException( javah + " failed with exit code " + result + " 0x" + Integer.toHexString( result ) ); } FileUtils.fileWrite( getTimestampDirectory() + "/" + getTimestampFile(), "" ); -- cgit v1.2.3