• Post Reply Bookmark Topic Watch Topic
  • New Topic

using Runtime class  RSS feed

 
ajse ruku
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
As we have an exec commmand in Runtime class,one constructer of which takes command name and environment on which the command should be run.What is this environment and how to get it,so that it can be passed to exec as parameter.Please let me know.

with regards,
ajse
 
Serkan Demir
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try System.getEnv() method.It returns a Map of environment variables of your OS.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See also ProcessBuilder (Java 5 and later) which provides some nice APIs for setting up the environment before you execute.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!