• Post Reply Bookmark Topic Watch Topic
  • New Topic

Runtime.getRuntime().exec()

 
Javedali Shaikh
Greenhorn
Posts: 12
Chrome Eclipse IDE Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all

I am working on an application (i.e. a library). I am usin gjava as a front-end and mysql as back-end. In this application I want to open book from the interface through java. The books are in different formats say .doc or .pdf. I want that the books to be opoen in their respective environment. For example if the extension is .doc then it should be opened in MS Word.
I search on net and found that the following statement works for the same:
Runtime.getRuntime().exec();

But my problem is that I am not getting what different parameters has to be passed and how to pass them in the funciton exec(). Also I don't know how exec() function works.

Hence I request you to please reply me as soon as possible.
 
Ananth Chellathurai
Ranch Hand
Posts: 349
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

should give you what you are looking for.

Ananth Chellathurai
Sysvine Technologies
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you have found Runtime.exec() but don't know how to use it. The first thing you should do is go the Java API and lookup the java.lang.Runtime class, then follow the links to one of the exec(...) methods to read how to use it (the one with the most parameters usually provides the most information).

Then it wouldn't hurt to do a quick Google Search on the subject. Undoubtedly you would find this key article, which is an absolute must read:
When Runtime.exec() won't on JavaWorld.
[ September 13, 2008: Message edited by: Steve Luke ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!