Reputation: 2309
This should be a pretty simple question, I can't believe I wasn't able to find anything from googling.
I'm using powershell and I'm trying to run a java app from command line:
$memory = "-Xms128m -Xmx1028m -XX:MaxPermSize=512m"
$ssl = "-Djavax.rmi.ssl.client.enabledProtocols=`"TLSv1`" -Djavax.rmi.ssl.client.enabledCipherSuites=`"_removed_`" -Djavax.net.ssl.trustStorePassword=`"_removed_`" -Djavax.net.ssl.trustStore=`"_removed_`" -Djavax.net.ssl.keyStorePassword=`"_removed_`" -Djavax.net.ssl.keyStore=`"_removed_`" -Djava.endorsed.dirs=`"$($ddmsLoc)tomcat6\endorsed`""
$classpath = getClasspath "manager" $null
$java_opts = "$($memory) $($ssl) -Djavax.net.debug=all"
$cmd = "$($java) $($java_opts) -cp `"$($classpath)`" dss.vector.solutions.manager.server.ServerStatus -g"
Invoke-Expression $cmd
But for some reason it thinks my JAVA_OPTS parameters are the name of the java class I'm running:
Caused by: java.lang.ClassNotFoundException: .rmi.ssl.client.enabledProtocols=TLSv1
I have tried:
I'm kind of at a loss here.
Upvotes: 1
Views: 2775
Reputation: 2309
Etan Reisner posted a comment that helped me to solve it:
Why does PowerShell split arguments containing hyphens and periods?
Windows is (for some reason) splitting the parameters in half.
echo -Dmy.param=value
returns:
-Dmy
.param=value
If the parameter is wrapped in quotes, like:
echo "-Dmy.param=value"
Then it works just fine.
Upvotes: 1