I am trying to execute a program using the mvn exec:java command.
I put this in a batch file (I am running Windows 11):
mvn exec:java -Dexec.mainClass=com.fiscalassets.tax.PrintForm1098s -Dexec.args="application.properties.FiscalAssets" -Djava.library.path="C:\OneDrive\Dev\Jacob"
But, when I run the batch file, I get this 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 command does not seem to be passing the java.library.path definition to the Java command.
Any suggestions on how to do this?
I figured it out. It turns out I had to change my command to use exec:exec and pass the arguments this way:
mvn exec:exec -Dexec.executable="java" -Dexec.args="-Djava.library.path=C:\OneDrive\Dev\Jacob -cp %classpath com.fiscalassets.tax.PrintForm1098s application.properties.FiscalAssets"