Re: How to pass java.library.path to mvn exec?
for the record, I find it simpler to hardcode it in the pom like this: -Djava.library.path=... Here is my pom: org.codehaus.mojo exec-maven-plugin runUnobfuscated java ${session.executionRootDirectory}/${buildDirectory}/natives/:${java.home}/lib/amd64/ ${PATH};${session.executionRootDirectory}/${buildDirectory}/natives/;${java.home}/lib/amd64/ 0 true true -Djava.library.path =${session.executionRootDirectory}/${buildDirectory}/natives/;${session.executionRootDirectory}/${buildDirectory}/natives//jre/bin -Ddev=true -Duser.language=en -XX:MaxDirectMemorySize=1024m [...] Le sam. 6 janv. 2024 à 16:20, Neil Aggarwal a écrit : > > As far as I get you should pass java.library.path in the java executable > > arguments > > Yes, that worked, thank you! > > Thank you, >Neil > > -- > Neil Aggarwal, 972-834-1565, http://propfinancing.com > We offer 30 year loans on single family houses! > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >
RE: How to pass java.library.path to mvn exec?
> As far as I get you should pass java.library.path in the java executable > arguments Yes, that worked, thank you! Thank you, Neil -- Neil Aggarwal, 972-834-1565, http://propfinancing.com We offer 30 year loans on single family houses! - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: How to pass java.library.path to mvn exec?
Sat, 6 Jan 2024 00:29:57 -0600, /Neil Aggarwal/: OK, so I changed to try to use the exec:exec goal. I updated the goal in my pom.xml (Attached) and tried this command line: mvn exec:exec -Dexec.executable="java" -Dexec.args="-cp %classpath com.fiscalassets.tax.PrintForm1098s application.properties.FiscalAssets" I still get this error: [...] It is not using the java.library.path I am giving it. As far as I get you should pass java.library.path in the java executable arguments: mvn exec:exec -Dexec.executable="java" -Dexec.args="-Djava.library.path=... application.properties.FiscalAssets" Alternatively, with exec:java try setting MAVEN_OPTS: set MAVEN_OPTS=-Djava.library.path=... mvn exec:java ... -- Stanimir - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: How to pass java.library.path to mvn exec?
> you either need to set it for the whole Maven process or fork your > execution, using exec:exec instead of exec:java. OK, so I changed to try to use the exec:exec goal. I updated the goal in my pom.xml (Attached) and tried this command line: mvn exec:exec -Dexec.executable="java" -Dexec.args="-cp %classpath com.fiscalassets.tax.PrintForm1098s application.properties.FiscalAssets" I still get this error: Exception in thread "main" java.lang.UnsatisfiedLinkError: no jacob-1.20-x64 in java.library.path: C:\Program Files\Java\jdk-17\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Cygwin\usr\local\bin;C:\Cygwin\bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\Common Files\Intuit\QBPOSSDKRuntime;C:\Program Files\Google\Google Apps Sync;C:\Program Files\Maven\bin;C:\Users\neil\AppData\Local\Microsoft\WindowsApps;. It is not using the java.library.path I am giving it. Thank you, Neil -- Neil Aggarwal, 972-834-1565, http://propfinancing.com We offer 30 year loans on single family houses! http://maven.apache.org/POM/4.0.0; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd;> 4.0.0 FAIntegration FAIntegration 0.0.1-SNAPSHOT com.jacob jacob 1.20 com.propfinancing pflib 5.0.0 in.hiaust unitedstates 1.1 org.apache.logging.log4j log4j-core 2.19.0 src src **/*.java maven-compiler-plugin 3.8.1 8 8 org.codehaus.mojo exec-maven-plugin 3.1.1 exec java.library.path C:\OneDrive\Dev\Jacob - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: How to pass java.library.path to mvn exec?
If you carefully read the docs that Nils pointed you to, ... >> https://www.mojohaus.org/exec-maven-plugin/java-mojo.html#systemProperties ... it says: > Note: as the execution is not forked, some system properties required > by the JVM cannot be passed here. Use MAVEN_OPTS or the exec:exec > instead. See the user guide for more information. java.library.path is one such property. It is read a single time when the JVM starts and then never again. From the JDK source code of class jdk.internal.util.StaticProperty: static { Properties props = System.getProperties(); JAVA_HOME = getProperty(props, "java.home"); USER_HOME = getProperty(props, "user.home"); USER_DIR = getProperty(props, "user.dir"); USER_NAME = getProperty(props, "user.name"); JAVA_IO_TMPDIR = getProperty(props, "java.io.tmpdir"); JAVA_LIBRARY_PATH = getProperty(props, "java.library.path", ""); // ... } I.e., you either need to set it for the whole Maven process or fork your execution, using exec:exec instead of exec:java. -- Alexander Kriegisch https://scrum-master.de Neil Aggarwal schrieb am 06.01.2024 05:08 (GMT +07:00): > OK, I set the system property in my pom.xml file, see attached. > > But I still get the same error when I run this command: > mvn > exec:java -Dexec.mainClass=com.fiscalassets.tax.PrintForm1098s > -Dexec.args=application.properties.FiscalAssets > > [ERROR] Failed to execute goal > org.codehaus.mojo:exec-maven-plugin:3.1.1:java (default-cli) on project > FAIntegration: An exception occurred while executing the Java class. no > jacob-1.20-x64 in java.library.path: > > ... > > The directory is not even listed in the directory list the JVM is searching > for. > > Did I get the configuration wrong? - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: How to pass java.library.path to mvn exec?
OK, I set the system property in my pom.xml file, see attached. But I still get the same error when I run this command: mvn exec:java -Dexec.mainClass=com.fiscalassets.tax.PrintForm1098s -Dexec.args=application.properties.FiscalAssets [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.1.1:java (default-cli) on project FAIntegration: An exception occurred while executing the Java class. no jacob-1.20-x64 in java.library.path: C:\Program Files\Java\jdk-17\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Cygwin\usr\local\bin;C:\Cygwin\bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\Common Files\Intuit\QBPOSSDKRuntime;C:\Program Files\Google\Google Apps Sync;C:\Program Files\Maven\bin;C:\Users\neil\AppData\Local\Microsoft\WindowsApps;. -> [Help 1] The directory is not even listed in the directory list the JVM is searching for. Did I get the configuration wrong? Thank you, Neil -- Neil Aggarwal, 972-834-1565, http://propfinancing.com We offer 30 year loans on single family houses! http://maven.apache.org/POM/4.0.0; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd;> 4.0.0 FAIntegration FAIntegration 0.0.1-SNAPSHOT com.jacob jacob 1.20 com.propfinancing pflib 5.0.0 in.hiaust unitedstates 1.1 org.apache.logging.log4j log4j-core 2.19.0 src src **/*.java maven-compiler-plugin 3.8.1 8 8 org.codehaus.mojo exec-maven-plugin 3.1.1 java java.library.path C:\OneDrive\Dev\Jacob - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: How to pass java.library.path to mvn exec?
Hi Neil, java.library.path is a system property. The Exec Maven Plugin documentation for exec:java and system properties is here: https://www.mojohaus.org/exec-maven-plugin/java-mojo.html#systemProperties Nils. > Op 5 jan 2024, om 17:40 heeft Neil Aggarwal het > volgende geschreven: > > Hello: > > > > I am trying to pass java.library.path to a mvn exec command. > > > > Here is what I tried: > > mvn exec:java -Dexec.mainClass=com.fiscalassets.tax.PrintForm1098s > -Dexec.args=application.properties.FiscalAssets > -Djava.library.path=C:\OneDrive\Dev\Jacob > > > > But, I get an error: > > [ERROR] Failed to execute goal > org.codehaus.mojo:exec-maven-plugin:3.1.0:java (default-cli) on project > FAIntegration: > > An exception occurred while executing the Java class. no jacob-1.20-x64 in > java.library.path: > > C:\Program > Files\Java\jdk-17\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Cygwin\usr\local\bin;C:\Cygwin\bin;C:\Program > Files\Common > Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program > Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA > Corporation\NVIDIA > NvDLISR;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program > Files (x86)\Common Files\Intuit\QBPOSSDKRuntime;C:\Program > Files\Google\Google Apps Sync;C:\Program > Files\Maven\bin;C:\Users\neil\AppData\Local\Microsoft\WindowsApps;. -> > [Help 1] > > > > The directory I passed to the command is not listed I the set of > directories in the output so I can only > > assume the argument did not work. > > > > I searched but I can’t find any info on this. Any idea what I am doing > wrong? > > > > Thank you, > > Neil > > > > -- > > Neil Aggarwal, 972-834-1565, http://propfinancing.com > > We offer 30 year loans on single family houses! - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
How to pass java.library.path to mvn exec?
Hello: I am trying to pass java.library.path to a mvn exec command. Here is what I tried: mvn exec:java -Dexec.mainClass=com.fiscalassets.tax.PrintForm1098s -Dexec.args=application.properties.FiscalAssets -Djava.library.path=C:\OneDrive\Dev\Jacob But, I get an error: [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.1.0:java (default-cli) on project FAIntegration: An exception occurred while executing the Java class. no jacob-1.20-x64 in java.library.path: C:\Program Files\Java\jdk-17\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Cygwin\usr\local\bin;C:\Cygwin\bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\Common Files\Intuit\QBPOSSDKRuntime;C:\Program Files\Google\Google Apps Sync;C:\Program Files\Maven\bin;C:\Users\neil\AppData\Local\Microsoft\WindowsApps;. -> [Help 1] The directory I passed to the command is not listed I the set of directories in the output so I can only assume the argument did not work. I searched but I can’t find any info on this. Any idea what I am doing wrong? Thank you, Neil -- Neil Aggarwal, 972-834-1565, http://propfinancing.com We offer 30 year loans on single family houses!