Open JDK 11 and javah in pom.xml





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







3















I switched my java version from java 8 to java 11 , and it seems that in java 11 javah is removed from JDK bin folder, before I was executing the javah command in my pom.xml like below



<execution>
<id>javah</id>
<goals>
<goal>exec</goal>
</goals>
<phase>compile</phase>
<configuration>
<executable>javah</executable>
<arguments>
<argument>-classpath</argument>
<argument>${project.build.outputDirectory}</argument>
<argument>-d</argument>
<argument>${build.path}/include</argument>
</arguments>
</configuration>
</execution>


Since javah has been removed from JDK 11 how can I replace the above javah command with javac -h in my pom to work with java 11



The error I get is



Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (javac -h) on project myProject: Command execution failed.: Process exited with an error: 2 (Exit value: 2)



Any idea?
Thanks










share|improve this question




















  • 2





    Could you share what didn't work for you with javac -h and how were you configuring it?

    – Naman
    Jan 3 at 10:37













  • see the above edit

    – wearybands
    Jan 3 at 10:48






  • 1





    The recommendation, since JDK 8, has been to use javac -h rather than javah. The javah tool was removed in JDK 10 via JEP 313.

    – Alan Bateman
    Jan 3 at 12:50


















3















I switched my java version from java 8 to java 11 , and it seems that in java 11 javah is removed from JDK bin folder, before I was executing the javah command in my pom.xml like below



<execution>
<id>javah</id>
<goals>
<goal>exec</goal>
</goals>
<phase>compile</phase>
<configuration>
<executable>javah</executable>
<arguments>
<argument>-classpath</argument>
<argument>${project.build.outputDirectory}</argument>
<argument>-d</argument>
<argument>${build.path}/include</argument>
</arguments>
</configuration>
</execution>


Since javah has been removed from JDK 11 how can I replace the above javah command with javac -h in my pom to work with java 11



The error I get is



Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (javac -h) on project myProject: Command execution failed.: Process exited with an error: 2 (Exit value: 2)



Any idea?
Thanks










share|improve this question




















  • 2





    Could you share what didn't work for you with javac -h and how were you configuring it?

    – Naman
    Jan 3 at 10:37













  • see the above edit

    – wearybands
    Jan 3 at 10:48






  • 1





    The recommendation, since JDK 8, has been to use javac -h rather than javah. The javah tool was removed in JDK 10 via JEP 313.

    – Alan Bateman
    Jan 3 at 12:50














3












3








3


1






I switched my java version from java 8 to java 11 , and it seems that in java 11 javah is removed from JDK bin folder, before I was executing the javah command in my pom.xml like below



<execution>
<id>javah</id>
<goals>
<goal>exec</goal>
</goals>
<phase>compile</phase>
<configuration>
<executable>javah</executable>
<arguments>
<argument>-classpath</argument>
<argument>${project.build.outputDirectory}</argument>
<argument>-d</argument>
<argument>${build.path}/include</argument>
</arguments>
</configuration>
</execution>


Since javah has been removed from JDK 11 how can I replace the above javah command with javac -h in my pom to work with java 11



The error I get is



Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (javac -h) on project myProject: Command execution failed.: Process exited with an error: 2 (Exit value: 2)



Any idea?
Thanks










share|improve this question
















I switched my java version from java 8 to java 11 , and it seems that in java 11 javah is removed from JDK bin folder, before I was executing the javah command in my pom.xml like below



<execution>
<id>javah</id>
<goals>
<goal>exec</goal>
</goals>
<phase>compile</phase>
<configuration>
<executable>javah</executable>
<arguments>
<argument>-classpath</argument>
<argument>${project.build.outputDirectory}</argument>
<argument>-d</argument>
<argument>${build.path}/include</argument>
</arguments>
</configuration>
</execution>


Since javah has been removed from JDK 11 how can I replace the above javah command with javac -h in my pom to work with java 11



The error I get is



Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (javac -h) on project myProject: Command execution failed.: Process exited with an error: 2 (Exit value: 2)



Any idea?
Thanks







java maven pom.xml java-11






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 3 at 13:00







wearybands

















asked Jan 3 at 10:19









wearybandswearybands

328115




328115








  • 2





    Could you share what didn't work for you with javac -h and how were you configuring it?

    – Naman
    Jan 3 at 10:37













  • see the above edit

    – wearybands
    Jan 3 at 10:48






  • 1





    The recommendation, since JDK 8, has been to use javac -h rather than javah. The javah tool was removed in JDK 10 via JEP 313.

    – Alan Bateman
    Jan 3 at 12:50














  • 2





    Could you share what didn't work for you with javac -h and how were you configuring it?

    – Naman
    Jan 3 at 10:37













  • see the above edit

    – wearybands
    Jan 3 at 10:48






  • 1





    The recommendation, since JDK 8, has been to use javac -h rather than javah. The javah tool was removed in JDK 10 via JEP 313.

    – Alan Bateman
    Jan 3 at 12:50








2




2





Could you share what didn't work for you with javac -h and how were you configuring it?

– Naman
Jan 3 at 10:37







Could you share what didn't work for you with javac -h and how were you configuring it?

– Naman
Jan 3 at 10:37















see the above edit

– wearybands
Jan 3 at 10:48





see the above edit

– wearybands
Jan 3 at 10:48




1




1





The recommendation, since JDK 8, has been to use javac -h rather than javah. The javah tool was removed in JDK 10 via JEP 313.

– Alan Bateman
Jan 3 at 12:50





The recommendation, since JDK 8, has been to use javac -h rather than javah. The javah tool was removed in JDK 10 via JEP 313.

– Alan Bateman
Jan 3 at 12:50












1 Answer
1






active

oldest

votes


















3














You should modify your execution as :



<execution>
<id>javach</id>
<goals>
<goal>exec</goal>
</goals>
<phase>compile</phase>
<configuration>
<executable>javac</executable>
<arguments>
<argument>-classpath</argument>
<argument>${project.build.outputDirectory}</argument>
<argument>-h</argument>
<argument>${build.path}/include</argument>
</arguments>
</configuration>
</execution>


based on the the javac --help




  -h <directory>
Specify where to place generated native header files






share|improve this answer
























  • I get this error [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (javac -h) on project myProject: Command execution failed.: Process exited with an error: 1 (Exit value: 1) -> [Help 1]

    – wearybands
    Jan 3 at 11:01








  • 1





    @wearybands Can you execute using mvn verify -X and share the detailed command e.g. [DEBUG] Executing command line: [javac, -classpath, .../target/classes, -h, .../include], next to which the exact cause would be listed for the error.

    – Naman
    Jan 3 at 11:07











  • sure just give me a few minutes

    – wearybands
    Jan 3 at 11:27






  • 1





    1. no source files is the cause then. 2. Ensure the path myProject exists 3. doesn't the path C:sbbuild/include look weird to you?

    – Naman
    Jan 3 at 12:13






  • 1





    @wearybands the values to the arguments are still incorrect to what I could observe. -h expects the directory where you want to generate the native header files... -d expects the directory where to place the generated class files i.e. corresponding .class file for your .java files..

    – Naman
    Jan 3 at 12:46












Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54020303%2fopen-jdk-11-and-javah-in-pom-xml%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














You should modify your execution as :



<execution>
<id>javach</id>
<goals>
<goal>exec</goal>
</goals>
<phase>compile</phase>
<configuration>
<executable>javac</executable>
<arguments>
<argument>-classpath</argument>
<argument>${project.build.outputDirectory}</argument>
<argument>-h</argument>
<argument>${build.path}/include</argument>
</arguments>
</configuration>
</execution>


based on the the javac --help




  -h <directory>
Specify where to place generated native header files






share|improve this answer
























  • I get this error [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (javac -h) on project myProject: Command execution failed.: Process exited with an error: 1 (Exit value: 1) -> [Help 1]

    – wearybands
    Jan 3 at 11:01








  • 1





    @wearybands Can you execute using mvn verify -X and share the detailed command e.g. [DEBUG] Executing command line: [javac, -classpath, .../target/classes, -h, .../include], next to which the exact cause would be listed for the error.

    – Naman
    Jan 3 at 11:07











  • sure just give me a few minutes

    – wearybands
    Jan 3 at 11:27






  • 1





    1. no source files is the cause then. 2. Ensure the path myProject exists 3. doesn't the path C:sbbuild/include look weird to you?

    – Naman
    Jan 3 at 12:13






  • 1





    @wearybands the values to the arguments are still incorrect to what I could observe. -h expects the directory where you want to generate the native header files... -d expects the directory where to place the generated class files i.e. corresponding .class file for your .java files..

    – Naman
    Jan 3 at 12:46
















3














You should modify your execution as :



<execution>
<id>javach</id>
<goals>
<goal>exec</goal>
</goals>
<phase>compile</phase>
<configuration>
<executable>javac</executable>
<arguments>
<argument>-classpath</argument>
<argument>${project.build.outputDirectory}</argument>
<argument>-h</argument>
<argument>${build.path}/include</argument>
</arguments>
</configuration>
</execution>


based on the the javac --help




  -h <directory>
Specify where to place generated native header files






share|improve this answer
























  • I get this error [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (javac -h) on project myProject: Command execution failed.: Process exited with an error: 1 (Exit value: 1) -> [Help 1]

    – wearybands
    Jan 3 at 11:01








  • 1





    @wearybands Can you execute using mvn verify -X and share the detailed command e.g. [DEBUG] Executing command line: [javac, -classpath, .../target/classes, -h, .../include], next to which the exact cause would be listed for the error.

    – Naman
    Jan 3 at 11:07











  • sure just give me a few minutes

    – wearybands
    Jan 3 at 11:27






  • 1





    1. no source files is the cause then. 2. Ensure the path myProject exists 3. doesn't the path C:sbbuild/include look weird to you?

    – Naman
    Jan 3 at 12:13






  • 1





    @wearybands the values to the arguments are still incorrect to what I could observe. -h expects the directory where you want to generate the native header files... -d expects the directory where to place the generated class files i.e. corresponding .class file for your .java files..

    – Naman
    Jan 3 at 12:46














3












3








3







You should modify your execution as :



<execution>
<id>javach</id>
<goals>
<goal>exec</goal>
</goals>
<phase>compile</phase>
<configuration>
<executable>javac</executable>
<arguments>
<argument>-classpath</argument>
<argument>${project.build.outputDirectory}</argument>
<argument>-h</argument>
<argument>${build.path}/include</argument>
</arguments>
</configuration>
</execution>


based on the the javac --help




  -h <directory>
Specify where to place generated native header files






share|improve this answer













You should modify your execution as :



<execution>
<id>javach</id>
<goals>
<goal>exec</goal>
</goals>
<phase>compile</phase>
<configuration>
<executable>javac</executable>
<arguments>
<argument>-classpath</argument>
<argument>${project.build.outputDirectory}</argument>
<argument>-h</argument>
<argument>${build.path}/include</argument>
</arguments>
</configuration>
</execution>


based on the the javac --help




  -h <directory>
Specify where to place generated native header files







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 3 at 10:51









NamanNaman

45.9k11102204




45.9k11102204













  • I get this error [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (javac -h) on project myProject: Command execution failed.: Process exited with an error: 1 (Exit value: 1) -> [Help 1]

    – wearybands
    Jan 3 at 11:01








  • 1





    @wearybands Can you execute using mvn verify -X and share the detailed command e.g. [DEBUG] Executing command line: [javac, -classpath, .../target/classes, -h, .../include], next to which the exact cause would be listed for the error.

    – Naman
    Jan 3 at 11:07











  • sure just give me a few minutes

    – wearybands
    Jan 3 at 11:27






  • 1





    1. no source files is the cause then. 2. Ensure the path myProject exists 3. doesn't the path C:sbbuild/include look weird to you?

    – Naman
    Jan 3 at 12:13






  • 1





    @wearybands the values to the arguments are still incorrect to what I could observe. -h expects the directory where you want to generate the native header files... -d expects the directory where to place the generated class files i.e. corresponding .class file for your .java files..

    – Naman
    Jan 3 at 12:46



















  • I get this error [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (javac -h) on project myProject: Command execution failed.: Process exited with an error: 1 (Exit value: 1) -> [Help 1]

    – wearybands
    Jan 3 at 11:01








  • 1





    @wearybands Can you execute using mvn verify -X and share the detailed command e.g. [DEBUG] Executing command line: [javac, -classpath, .../target/classes, -h, .../include], next to which the exact cause would be listed for the error.

    – Naman
    Jan 3 at 11:07











  • sure just give me a few minutes

    – wearybands
    Jan 3 at 11:27






  • 1





    1. no source files is the cause then. 2. Ensure the path myProject exists 3. doesn't the path C:sbbuild/include look weird to you?

    – Naman
    Jan 3 at 12:13






  • 1





    @wearybands the values to the arguments are still incorrect to what I could observe. -h expects the directory where you want to generate the native header files... -d expects the directory where to place the generated class files i.e. corresponding .class file for your .java files..

    – Naman
    Jan 3 at 12:46

















I get this error [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (javac -h) on project myProject: Command execution failed.: Process exited with an error: 1 (Exit value: 1) -> [Help 1]

– wearybands
Jan 3 at 11:01







I get this error [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (javac -h) on project myProject: Command execution failed.: Process exited with an error: 1 (Exit value: 1) -> [Help 1]

– wearybands
Jan 3 at 11:01






1




1





@wearybands Can you execute using mvn verify -X and share the detailed command e.g. [DEBUG] Executing command line: [javac, -classpath, .../target/classes, -h, .../include], next to which the exact cause would be listed for the error.

– Naman
Jan 3 at 11:07





@wearybands Can you execute using mvn verify -X and share the detailed command e.g. [DEBUG] Executing command line: [javac, -classpath, .../target/classes, -h, .../include], next to which the exact cause would be listed for the error.

– Naman
Jan 3 at 11:07













sure just give me a few minutes

– wearybands
Jan 3 at 11:27





sure just give me a few minutes

– wearybands
Jan 3 at 11:27




1




1





1. no source files is the cause then. 2. Ensure the path myProject exists 3. doesn't the path C:sbbuild/include look weird to you?

– Naman
Jan 3 at 12:13





1. no source files is the cause then. 2. Ensure the path myProject exists 3. doesn't the path C:sbbuild/include look weird to you?

– Naman
Jan 3 at 12:13




1




1





@wearybands the values to the arguments are still incorrect to what I could observe. -h expects the directory where you want to generate the native header files... -d expects the directory where to place the generated class files i.e. corresponding .class file for your .java files..

– Naman
Jan 3 at 12:46





@wearybands the values to the arguments are still incorrect to what I could observe. -h expects the directory where you want to generate the native header files... -d expects the directory where to place the generated class files i.e. corresponding .class file for your .java files..

– Naman
Jan 3 at 12:46




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54020303%2fopen-jdk-11-and-javah-in-pom-xml%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

'app-layout' is not a known element: how to share Component with different Modules

android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

WPF add header to Image with URL pettitions [duplicate]