Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2008

Tip: Looking for answers? Try searching our database.

waitFor returns 255 on HP Unix

Thread view: 
Jakir - 26 Aug 2004 01:03 GMT
Hi

waitFor() method returns value 255 on HP Unix when I try to start
netscape through Runtime.getRuntime().exec("netscape") method.
I also tried to give the full path but same results.
I am able to start netscape from C program or from commandline but it
fails when I try to do same thing from Java application.

It works fine on Solaris.
What is the meaning of value 255. Where I can get the information
regarding the value returned by the waitFor() method.

Regards
Jakir
Paul Lutus - 26 Aug 2004 01:53 GMT
> Hi
>
> waitFor() method returns value 255 on HP Unix when I try to start
> netscape through Runtime.getRuntime().exec("netscape") method.

Most likely, this is a -1, but you don't say how you stored or printed it.

> I also tried to give the full path but same results.
> I am able to start netscape from C program or from commandline but it
> fails when I try to do same thing from Java application.

Post the code and say where the application is located on your system.

> It works fine on Solaris.
> What is the meaning of value 255. Where I can get the information
> regarding the value returned by the waitFor() method.

Uhh, the documentation?

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Process.html#waitFor()

Signature

Paul Lutus
http://www.arachnoid.com

Jakir - 26 Aug 2004 17:58 GMT
import java.io.IOException;

class javaHello {
  public static void main(String[] args) {
           try
           {
                 Process p = Runtime.getRuntime().exec("netscape");
          /* Also tried full path */
              try
              {
                   int exitCode = p.waitFor();
                   if(exitCode != 0)
                      System.out.println(exitCode);
              }
              catch(InterruptedException x)
              {
                System.err.println("Caught:" + x);
              }
           }
           catch(IOException e)
           {
                e.printStackTrace();  
               System.out.println("Failed to start.\n" + e);
           }
  }
}

> > Hi
> >
[quoted text clipped - 16 lines]
>
> http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Process.html#waitFor()
kev - 28 Apr 2008 11:03 GMT
hi find some gread deals here.

great deals on games
http://www.find-a-great-deal.blogspot.com

find out how to earn free easy cash here
http://www.find-a-deal.blogspot.com

easy cash will show you the way to make fast easy cash
http://www.niceeasy-cash.blogspot.com


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.