diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/apache/maven/plugin/nar/Javah.java | 9 |
1 files changed, 6 insertions, 3 deletions
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(), "" ); |