-3

Tried with following:

ProcessBuilder Runtime.exec()

but not able to execute?

My curl request

ProcessBuilder pb = new ProcessBuilder( "curl",
    "-H Content-type: text/xml;charset=UTF-8",
    "-d @acd.xml" , 
    "-k "
    ,"\"https://127.0.0.1:4443/s1/ssdces/dfing/v2\"", 
    "--tlsdv1");

I got an error

curl: (1) Protocol "https not supported or disabled in libcurl

but I have already specified -k for insecure connection

curl --version curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.21 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2 Protocols: tftp ftp telnet dict ldap ldaps http file https ftps scp sftp Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz

Terminal is working fine but when try to use using java it gives above error

7
  • 2
    Please post all the necessary code to reproduce the issue and post the exact error you get, along with the stacktrace.
    – BackSlash
    Feb 9, 2017 at 12:53
  • 2
    There are zero details in this question.
    – f1sh
    Feb 9, 2017 at 12:54
  • but I am not getting any error.. Feb 9, 2017 at 12:57
  • Have you read/captured ErrorStream? Feb 9, 2017 at 13:02
  • ProcessBuilder pb = new ProcessBuilder( "curl" ,"-H Content-type: text/xml;charset=UTF-8" ,"-d @acd.xml" , "-k \"127.0.0.1:4443/s1/ssdces/dfing/v2\"" , "--tlsdv1"); Feb 9, 2017 at 13:02

1 Answer 1

0

Maybe something like that will work?

 Process p = new ProcessBuilder("myCommand", "myArg").start();
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.