<?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 Runtime.exec() in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/java-runtime-exec/m-p/4080634#M38575</link>
    <description>Thank you.&lt;BR /&gt;&lt;BR /&gt;I saw that a month ago and could not find it today. I spent all morning looking. I do not know why I did not find it.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 03 Oct 2007 13:51:09 GMT</pubDate>
    <dc:creator>Nicholas Beeson</dc:creator>
    <dc:date>2007-10-03T13:51:09Z</dc:date>
    <item>
      <title>Java Runtime.exec()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-runtime-exec/m-p/4080631#M38572</link>
      <description>I am writing a Java program which needs to run&lt;BR /&gt;Runtime.exec(). I have gotten it to work but it only works if I issue it *twice* ! What it that about?&lt;BR /&gt;&lt;BR /&gt;I know that Runtime.exec() must have a command procedure filename as its parameter, and that on OpenVMS it will execute the command procedure file.&lt;BR /&gt;&lt;BR /&gt;An earlier answer said "look at the documentation for the Java r.exec mechanism...  the r.exec ... expects a filename, and not a DCL command."&lt;BR /&gt;&lt;A href="http://h71000.www7.hp.com/wizard/wiz_9903.html" target="_blank"&gt;http://h71000.www7.hp.com/wizard/wiz_9903.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;"You cannot exec() a DCL verb in the OpenVMS Java environment. For details of this and for a potential workaround, please view the Java 1.2.2 release notes for OpenVMS, available via:&lt;BR /&gt;&lt;A href="http://www.compaq.com/java/" target="_blank"&gt;http://www.compaq.com/java/&lt;/A&gt;"&lt;BR /&gt;&lt;A href="http://h71000.www7.hp.com/wizard/wiz_6733.html" target="_blank"&gt;http://h71000.www7.hp.com/wizard/wiz_6733.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I cannot find any other information. I have read the *entire* current "Java Release Notes" and found nothing about this.</description>
      <pubDate>Wed, 03 Oct 2007 12:16:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-runtime-exec/m-p/4080631#M38572</guid>
      <dc:creator>Nicholas Beeson</dc:creator>
      <dc:date>2007-10-03T12:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Java Runtime.exec()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-runtime-exec/m-p/4080632#M38573</link>
      <description>&lt;BR /&gt;Could you show us your actual line of code?&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Oct 2007 12:27:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-runtime-exec/m-p/4080632#M38573</guid>
      <dc:creator>EdgarZamora_1</dc:creator>
      <dc:date>2007-10-03T12:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: Java Runtime.exec()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-runtime-exec/m-p/4080633#M38574</link>
      <description>ATW has been shut down for five or so years now; I'd not tend to assume details there are the most current.&lt;BR /&gt;&lt;BR /&gt;To enable tracing:&lt;BR /&gt;&lt;BR /&gt;$ define/job JAVA$EXEC_TRACE true&lt;BR /&gt;&lt;BR /&gt;Here's some doc on what syntax works:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://h18012.www1.hp.com/java/documentation/1.5.0/ivms/docs/user_guide.html#workingwruntimeexec" target="_blank"&gt;http://h18012.www1.hp.com/java/documentation/1.5.0/ivms/docs/user_guide.html#workingwruntimeexec&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;And in addition to the r.exec command, what's in the procedure you are invoking?</description>
      <pubDate>Wed, 03 Oct 2007 13:13:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-runtime-exec/m-p/4080633#M38574</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2007-10-03T13:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Java Runtime.exec()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-runtime-exec/m-p/4080634#M38575</link>
      <description>Thank you.&lt;BR /&gt;&lt;BR /&gt;I saw that a month ago and could not find it today. I spent all morning looking. I do not know why I did not find it.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Oct 2007 13:51:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-runtime-exec/m-p/4080634#M38575</guid>
      <dc:creator>Nicholas Beeson</dc:creator>
      <dc:date>2007-10-03T13:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: Java Runtime.exec()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-runtime-exec/m-p/4080635#M38576</link>
      <description>Nicolas,&lt;BR /&gt;&lt;BR /&gt;to begin with:&lt;BR /&gt;&lt;BR /&gt;WELCOME to the VMS forum!&lt;BR /&gt;&lt;BR /&gt;On how to thank those that helped you in this forum, please review&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/helptips.do?#33" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/helptips.do?#33&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe</description>
      <pubDate>Wed, 03 Oct 2007 14:31:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-runtime-exec/m-p/4080635#M38576</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2007-10-03T14:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Java Runtime.exec()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-runtime-exec/m-p/4080636#M38577</link>
      <description>proc = theRunTime.exec(cmdFileName);&lt;BR /&gt;&lt;BR /&gt;cmdFileName is a file created on the fly by the Java program. It contains:&lt;BR /&gt;$ set file $1$D26:[adir.thedir]*.*;* /protection=(OWNER:RWED)&lt;BR /&gt;$ delete $1$D26:[adir.thedir]*.*;*&lt;BR /&gt;$ EXIT&lt;BR /&gt;&lt;BR /&gt;This is unreliable. Every other time it run this Java program these files do not get deleted. &lt;BR /&gt;&lt;BR /&gt;Is this because OpenVMS does not recognize the process created by the Java Runtime.exec() as being owned by me?&lt;BR /&gt;&lt;BR /&gt;That is I am the owner of the files, the dir, and the Java program. When the Java program runs the Runtime.exec() method, who does OpenVMS think the owner is?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Oct 2007 14:36:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-runtime-exec/m-p/4080636#M38577</guid>
      <dc:creator>Nicholas Beeson</dc:creator>
      <dc:date>2007-10-04T14:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: Java Runtime.exec()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-runtime-exec/m-p/4080637#M38578</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;$ set file $1$D26:[adir.thedir]*.*;* /protection=(OWNER:RWED)&lt;BR /&gt;$ delete $1$D26:[adir.thedir]*.*;*&lt;BR /&gt;$ EXIT&lt;BR /&gt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;&lt;BR /&gt;$ set noon&lt;BR /&gt;$ set file $1$DGA26:[adir.thedir]*.*;* /protection=(OWNER:RWED)&lt;BR /&gt;$ delete $1$DGA26:[adir.thedir]*.*;*&lt;BR /&gt;$ exit&lt;BR /&gt;&lt;BR /&gt;Two changes: the file is protected against an error exit (due to a file conflict, for instance), and second change is the full specification of the target device (with $1$DGA26: assumed here).&lt;BR /&gt;&lt;BR /&gt;I'd probably have a system-level logical name referencing the $1$DGA26:[adir.thedir] path, so that I didn't have the physical path coded all over the place.&lt;BR /&gt;&lt;BR /&gt;And I'd expect an unlink or other more direct file deletion call would be useful; dropping down to DCL to delete files seems like Real Work.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;This is unreliable. Every other time it run this Java program these files do not get deleted.&lt;BR /&gt;&lt;BR /&gt;Is this because OpenVMS does not recognize the process created by the Java Runtime.exec() as being owned by me?&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;&lt;BR /&gt;If it were protections or ownership involved here, the failure would be more consistent.  The delete command would fail every time, for instance. I'd tend to guess this might be a collision with other activity within the directory.  Possibly the Java code that's running right now, or possibly some other code operating in parallel.&lt;BR /&gt;&lt;BR /&gt;Specific suggestion: enable the tracing and see what's going on.  Or have the DCL procedure itself wrap the actual commands, and go look there.  Something akin to the following:&lt;BR /&gt;&lt;BR /&gt;$ set noon&lt;BR /&gt;$ call foo/out=ddcu:[dir]log&lt;BR /&gt;$ exit&lt;BR /&gt;$foo: subroutine&lt;BR /&gt;$ set noon&lt;BR /&gt;$ set verify&lt;BR /&gt;$ set file $1$DGA26:[adir.thedir]*.*;* /protection=(OWNER:RWED)&lt;BR /&gt;$ delete $1$DGA26:[adir.thedir]*.*;*&lt;BR /&gt;$ endsubroutine&lt;BR /&gt;&lt;BR /&gt;I don't know that the above will work in this run-time context, but it's what I would try if tracing didn't show what I needed.  Change ddcu:[dir] to be a directory path that is (for the purposes of this test) globally accessible and globally writable.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Oct 2007 14:59:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-runtime-exec/m-p/4080637#M38578</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2007-10-04T14:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Java Runtime.exec()</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/java-runtime-exec/m-p/4080638#M38579</link>
      <description>I am all set. The problem I was having was due to not consuming the output of OpenVMS as it ran the Command Prodedure. It says in the Java Runteim.exec() documentation "Because some native platforms only provide limited buffer size for standard input and output streams, failure to promptly write the input stream or read the output stream of the subprocess may cause the subprocess to block, and even deadlock."&lt;BR /&gt;&lt;BR /&gt;I have run tests and have demonstrated that this was what was causing my problem.&lt;BR /&gt;&lt;BR /&gt;Thanks to eveyone who responded. (I posted points.)</description>
      <pubDate>Thu, 04 Oct 2007 14:59:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/java-runtime-exec/m-p/4080638#M38579</guid>
      <dc:creator>Nicholas Beeson</dc:creator>
      <dc:date>2007-10-04T14:59:58Z</dc:date>
    </item>
  </channel>
</rss>

