The Artima Developer Community
Sponsored Link

Java Answers Forum
Runtime.exec with openssl/cmd

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Diana

Posts: 1
Nickname: dandrade
Registered: Nov, 2004

Runtime.exec with openssl/cmd Posted: Nov 8, 2004 9:56 AM
Reply to this message Reply
Advertisement
Hi all,
I have done a program in java and I need to use the openssl program (which is coded in C...). Instead of using the src files, as I only need standard commands from openssl, I thought it would be easier to invoke the command line from my java code using the Runtime.exec() method.
I have installed a version of openssl which runs in Windows and I can do what I want both from the DOS prompt or with a simple .bat file with the instruction I want to execute.
The weird thing is that when I try to execute this from java with the Runtime.exec command it doesn't fail but doesn't make anything either!
I've tried opening the openssl prompt screen with:
Runtime.exec("openssl") (note openssl.exe is in the path and typing openssl in the "Run" option of the Windows Start menu opens the openssl window as expected)
And also tried to execute a simple .bat file with:
Runtime.exec("c:\\test.bat") (if double-clicking the test.bat file the command is executed correctly)
In both scenarios the java code ends without any exception but doesn't do anything! I'm getting desperate...
I don't know if there could be any relation to this, but I also can't open a DOS window: Runtime.exec("cmd"), getting the same strange behaviour, but if I open any other program, e.g. Runtime.exec("notepad") it opens a notepad window!
Any clue?
T.I.A.
Diana.

Topic: JProgressBar not rendering in time Previous Topic   Next Topic Topic: diff between hash map & hash table

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use