java "$homeOption" -cp "$classPath" "com.civilizer.extra.tools.DataBroker" -import "$importPath"
If $homeOption is not empty, the command above works, but $homeOption is empty, it can't find the main class
Error: Could not find or load main class
Looks like Empty $homeOption parameter affects classpath string in a bad way; It's so strange behavior to me;
Anyone running into this issue and understanding why?
Edit:
In case that it works:
The actual command line is as follows;
com.civilizer.extra.tools.DataBroker is a Java class with main method, and it is included in that verbose classpath;
in this case, $homeOption is -Dcivilizer.private_home_path=/Users/bsw/.civilizer
java -Dcivilizer.private_home_path=/Users/bsw/.civilizer -cp /Users/bsw/test/trysomething/civilizer/target/civilizer-1.0.0.CI-SNAPSHOT/WEB-INF/classes:/Users/bsw/test/trysomething/civilizer/extra/lib/:/Users/bsw/test/trysomething/civilizer/target/civilizer-1.0.0.CI-SNAPSHOT/WEB-INF/lib/:/Users/bsw/test/trysomething/civilizer/target/extra com.civilizer.extra.tools.DataBroker -import
In case that it can't find the main class:
java -cp /Users/bsw/test/trysomething/civilizer/target/civilizer-1.0.0.CI-SNAPSHOT/WEB-INF/classes:/Users/bsw/test/trysomething/civilizer/extra/lib/:/Users/bsw/test/trysomething/civilizer/target/civilizer-1.0.0.CI-SNAPSHOT/WEB-INF/lib/:/Users/bsw/test/trysomething/civilizer/target/extra com.civilizer.extra.tools.DataBroker -import
As I mentioned, only $homeOption is empty; but it just makes the issue; BTW, even if $homeOption is empty, the class will run without a problem, but you know, the main method is missing in the first place in this case, it doesn't matter
DataBrokerthe class with themainmethod? If not, what is the name of the class that has themainmethod. What is the value set inhomeOptionwhen it is not empty. Please share all relevant information that will help you to get to the bottom of this.