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: [email protected]
For additional commands, e-mail: [email protected]