• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Startup tomact server from java application using Runtime class  RSS feed

 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,


I am trying to start tomcat server through java application by making use of Runtime class in java .But it is compiling properly ,but when i try to rum program ,it wont start tomcat server,instead it will show java.lang.ProcessImpl@11b86e7 in command window.

Can anyone please tell me how to run server from java application.

I am posting code here ,if there is any mistake in code ,please inform me that


[ September 25, 2006: Message edited by: harish thrivile ]
 
author and iconoclast
Posts: 24203
43
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you know it's not starting Tomcat? Did you try connecting to it?

The output from Tomcat (or any process you start) won't go to the screen; it goes to a "pipe" so that you can read it from your Java program. Call getInputStream() on the Process returned from your exec() call, read everything from the stream and print it to the screen, if you want to be able to see it.
 
Harish Tiruvile
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Ernest Friedman-Hill,

I have resolved the problem..By using waitFor() (which is inside Process class ).

But really thanks for your idea,it will help me when i work on some other commands
[ September 25, 2006: Message edited by: harish thrivile ]
 
Bring out your dead! Or a tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!