{"id":4703,"date":"2014-03-30T14:46:48","date_gmt":"2014-03-30T14:46:48","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/unable-to-read-from-process-standardoutput-collection-of-common-programming-errors\/"},"modified":"2014-03-30T14:46:48","modified_gmt":"2014-03-30T14:46:48","slug":"unable-to-read-from-process-standardoutput-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/unable-to-read-from-process-standardoutput-collection-of-common-programming-errors\/","title":{"rendered":"Unable to read from Process.StandardOutput-Collection of common programming errors"},"content":{"rendered":"<p>You can read the currently installed Java version from the registry as well. The following file includes the method <code>TryGetJavaHome<\/code>, which supports 32- and 64-bit virtual machines for specific vendor\/installation combinations.<\/p>\n<pre><code>bool TryGetJavaHome(\n    RegistryView registryView,\n    string vendor,\n    string installation,\n    out string javaHome)\n<\/code><\/pre>\n<p>Vendors:<\/p>\n<ul>\n<li>&#8220;JavaSoft&#8221; (HotSpot)<\/li>\n<li>&#8220;JRockit&#8221;<\/li>\n<\/ul>\n<p>Installations:<\/p>\n<ul>\n<li>&#8220;Java Runtime Environment&#8221;<\/li>\n<li>&#8220;Java Development Kit&#8221;<\/li>\n<\/ul>\n<p>If you look at the code for the method, you&#8217;ll find the following line which obtains the current version.<\/p>\n<pre><code>object currentVersion = javaKey.GetValue(\"CurrentVersion\");\n<\/code><\/pre>\n<p>This will return a value like &#8220;1.7&#8221; or &#8220;1.6&#8221;. If want a more complete version number, <em>some<\/em> installations provide the following.<\/p>\n<pre><code>object familyVersion6 = javaKey.GetValue(\"Java6FamilyVersion\");\nobject familyVersion7 = javaKey.GetValue(\"Java7FamilyVersion\");\n<\/code><\/pre>\n<p>For some installations, the family version is not present, but for the standard runtime installation I see the values &#8220;1.6.0_38&#8221; and &#8220;1.7.0_13&#8221;.<\/p>\n<p><strong>Reference:<\/strong> Antlr4ClassGenerationTaskInternal.cs<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can read the currently installed Java version from the registry as well. The following file includes the method TryGetJavaHome, which supports 32- and 64-bit virtual machines for specific vendor\/installation combinations. bool TryGetJavaHome( RegistryView registryView, string vendor, string installation, out string javaHome) Vendors: &#8220;JavaSoft&#8221; (HotSpot) &#8220;JRockit&#8221; Installations: &#8220;Java Runtime Environment&#8221; &#8220;Java Development Kit&#8221; If you [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4703","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4703","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4703"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4703\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4703"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4703"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4703"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}