<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Java code to launch browser on HP-UX 11.0 in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/java-code-to-launch-browser-on-hp-ux-11-0/m-p/2830326#M938428</link>
    <description>Hi Michael,&lt;BR /&gt;&lt;BR /&gt;I've tried your code and I get the same behavior as I do with my code, (i've added process.waitfor() to eliminate the exception).  In other words, it loads the web page when the browser is up, but seems to do nothing if the browser is not up, including no errors.  &lt;BR /&gt;&lt;BR /&gt;The same code works fine on a Solaris machine, so I don't think it is a Java issue.  I think the problem might be with a path/environment setting or perhaps a patch that has to be installed.&lt;BR /&gt;&lt;BR /&gt;Anyone have any other recommendations?  Are others using the same OS?  HP-UX 11.0, Netscape 4.79, JRE 1.4&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;ken</description>
    <pubDate>Wed, 23 Oct 2002 17:19:39 GMT</pubDate>
    <dc:creator>Kenneth Stoutzenberger</dc:creator>
    <dc:date>2002-10-23T17:19:39Z</dc:date>
    <item>
      <title>Java code to launch browser on HP-UX 11.0</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/java-code-to-launch-browser-on-hp-ux-11-0/m-p/2830321#M938423</link>
      <description>Does anyone know why the following java code will not launch the netscape browser? &lt;BR /&gt;&lt;BR /&gt;Runtime.getRuntime().exec(cmd) &lt;BR /&gt;where &lt;BR /&gt;cmd = netscape &lt;A href="http://somepage.com" target="_blank"&gt;http://somepage.com&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Netscape is located in /opt/netscape and this is in my PATH variable and it is set to my default web browser for NNM. Is there anything I am missing, such as a patch or something? I'm using HP-UX 11.0 and Netscape 4.79 JRE 1.4.0.01 &lt;BR /&gt;&lt;BR /&gt;I have code similar to that above where cmd = netscape -remote openURL(&lt;A href="http://somepage.com)" target="_blank"&gt;http://somepage.com)&lt;/A&gt;  This displays my web page OK as long as the browser is already open.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Mon, 21 Oct 2002 22:22:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/java-code-to-launch-browser-on-hp-ux-11-0/m-p/2830321#M938423</guid>
      <dc:creator>Kenneth Stoutzenberger</dc:creator>
      <dc:date>2002-10-21T22:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: Java code to launch browser on HP-UX 11.0</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/java-code-to-launch-browser-on-hp-ux-11-0/m-p/2830322#M938424</link>
      <description>Hello-&lt;BR /&gt;&lt;BR /&gt;Quick questions-&lt;BR /&gt;&lt;BR /&gt;- Are you getting any errors on the screen when this code is executed?&lt;BR /&gt;&lt;BR /&gt;- Is your environment variable (DISPLAY) set when this code is executed?&lt;BR /&gt;&lt;BR /&gt;Mike</description>
      <pubDate>Mon, 21 Oct 2002 23:42:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/java-code-to-launch-browser-on-hp-ux-11-0/m-p/2830322#M938424</guid>
      <dc:creator>Michael Elleby III_1</dc:creator>
      <dc:date>2002-10-21T23:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: Java code to launch browser on HP-UX 11.0</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/java-code-to-launch-browser-on-hp-ux-11-0/m-p/2830323#M938425</link>
      <description>Mike,&lt;BR /&gt;&lt;BR /&gt;Yes, the DISPLAY variable is set. DISPLAY=lucy:0.0&lt;BR /&gt;&lt;BR /&gt;I am catching the exception, "process hasn't exited" using the following code fragment:&lt;BR /&gt;&lt;BR /&gt;Process p = Runtime.getRuntime().exec(cmd);&lt;BR /&gt;&lt;BR /&gt;try{&lt;BR /&gt;  exitCode = p.exitValue();&lt;BR /&gt;}&lt;BR /&gt;catch(IllegalThreadStateException itse){&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;note: cmd=netscape &lt;A href="http://somepage.com" target="_blank"&gt;http://somepage.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Tue, 22 Oct 2002 00:25:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/java-code-to-launch-browser-on-hp-ux-11-0/m-p/2830323#M938425</guid>
      <dc:creator>Kenneth Stoutzenberger</dc:creator>
      <dc:date>2002-10-22T00:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Java code to launch browser on HP-UX 11.0</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/java-code-to-launch-browser-on-hp-ux-11-0/m-p/2830324#M938426</link>
      <description>as the nescape remote interface is "not that handy" you may want to build a wrapper that does what you would expect on the command line.&lt;BR /&gt;&lt;BR /&gt;example:&lt;BR /&gt;$ cat $HOME/bin/url&lt;BR /&gt;LOG=$HOME/.`basename $0`.log&lt;BR /&gt;NOW=`date '+%y%m%d_%H%M%S'`&lt;BR /&gt;echo $NOW $* &amp;gt;&amp;gt; $LOG&lt;BR /&gt;echo $* #&amp;gt;2&amp;amp; &lt;BR /&gt;date #&amp;gt;2&amp;amp;&lt;BR /&gt;if [ X$DISPLAY = X ] ; then export DISPLAY=$IP:0.0 ; fi&lt;BR /&gt;/opt/netscape/netscape -install -display $DISPLAY -remote "openURL ( $* ,new-window)" &lt;BR /&gt;#The End.&lt;BR /&gt;$url &lt;A href="http://www.hp.com" target="_blank"&gt;www.hp.com&lt;/A&gt; #opens a new browser window with &lt;A href="http://www.hp.com" target="_blank"&gt;http://www.hp.com&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;taking this a step further you may have &lt;BR /&gt;$cat google&lt;BR /&gt;url &lt;A href="http://www.google.com" target="_blank"&gt;www.google.com&lt;/A&gt;&lt;BR /&gt;#The End.&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;you get the idea... not sure if that really helps for java- however, worth to try.</description>
      <pubDate>Wed, 23 Oct 2002 08:24:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/java-code-to-launch-browser-on-hp-ux-11-0/m-p/2830324#M938426</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-10-23T08:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Java code to launch browser on HP-UX 11.0</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/java-code-to-launch-browser-on-hp-ux-11-0/m-p/2830325#M938427</link>
      <description>Hi Ken,&lt;BR /&gt;&lt;BR /&gt;the "process has not exited" error is logical (and means netscape is still running). There is either something wrong in your DISPLAY or your PATH variable. Try to put them in your code, or use a wrapper script as Thomas suggested (good idea, actually). It is also safer to pass the exec() method a string array containing the options passed to the program you want to start.&lt;BR /&gt;&lt;BR /&gt;The attached code worked on my system - it opens netscape with the URL "&lt;A href="http://www.hp.com" target="_blank"&gt;http://www.hp.com&lt;/A&gt;".&lt;BR /&gt;&lt;BR /&gt;Hope it helps...&lt;BR /&gt; Michael</description>
      <pubDate>Wed, 23 Oct 2002 11:35:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/java-code-to-launch-browser-on-hp-ux-11-0/m-p/2830325#M938427</guid>
      <dc:creator>Michael Armbrecht</dc:creator>
      <dc:date>2002-10-23T11:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: Java code to launch browser on HP-UX 11.0</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/java-code-to-launch-browser-on-hp-ux-11-0/m-p/2830326#M938428</link>
      <description>Hi Michael,&lt;BR /&gt;&lt;BR /&gt;I've tried your code and I get the same behavior as I do with my code, (i've added process.waitfor() to eliminate the exception).  In other words, it loads the web page when the browser is up, but seems to do nothing if the browser is not up, including no errors.  &lt;BR /&gt;&lt;BR /&gt;The same code works fine on a Solaris machine, so I don't think it is a Java issue.  I think the problem might be with a path/environment setting or perhaps a patch that has to be installed.&lt;BR /&gt;&lt;BR /&gt;Anyone have any other recommendations?  Are others using the same OS?  HP-UX 11.0, Netscape 4.79, JRE 1.4&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;ken</description>
      <pubDate>Wed, 23 Oct 2002 17:19:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/java-code-to-launch-browser-on-hp-ux-11-0/m-p/2830326#M938428</guid>
      <dc:creator>Kenneth Stoutzenberger</dc:creator>
      <dc:date>2002-10-23T17:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Java code to launch browser on HP-UX 11.0</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/java-code-to-launch-browser-on-hp-ux-11-0/m-p/2830327#M938429</link>
      <description>Hi Ken,&lt;BR /&gt;&lt;BR /&gt;I tried it again on a different HP-UX machine and it didn't open netscape there, either. The only way to make it work was making a script calling netscape with the necessary parameters (display, URL) and call this script (startnetscape.sh) from the java program. That definitely worked. This seems to be an issue specifically with netscape, though. Starting e.g. xclock directly from the java program was no problem.&lt;BR /&gt;&lt;BR /&gt; Regards&lt;BR /&gt;   Michael</description>
      <pubDate>Thu, 24 Oct 2002 10:29:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/java-code-to-launch-browser-on-hp-ux-11-0/m-p/2830327#M938429</guid>
      <dc:creator>Michael Armbrecht</dc:creator>
      <dc:date>2002-10-24T10:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: Java code to launch browser on HP-UX 11.0</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/java-code-to-launch-browser-on-hp-ux-11-0/m-p/2830328#M938430</link>
      <description>&lt;BR /&gt;I did some testing by getting the input stream from the runtime process used to call netscape from the Java code.  I received an error that said I should check the XFILESEARCHPATH, XUSERFILESEARCHPATH, and one other variable (i'm at home right now so I don't recall the name).  Anyway, I did an echo $var on all three and none were set.  I tried adding them to my .dtprofile and setting the path to netscape, but it still didn't work.&lt;BR /&gt;&lt;BR /&gt;I switched to using Netscape 6.2 and all is well now. I am able to launch the browser with my original Java code. One difference: on Netscape 4.79, if the process fails (browser not open), the exitValue() returns a value other than 0 (1).  On Netscape 6.2, when the process fails (browser not open), the exitValue() returns 0.  So, just have to code for those differences.&lt;BR /&gt;&lt;BR /&gt;Regards, and thanks for everyone's help&lt;BR /&gt;</description>
      <pubDate>Fri, 25 Oct 2002 04:28:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/java-code-to-launch-browser-on-hp-ux-11-0/m-p/2830328#M938430</guid>
      <dc:creator>Kenneth Stoutzenberger</dc:creator>
      <dc:date>2002-10-25T04:28:15Z</dc:date>
    </item>
  </channel>
</rss>

