{"id":4004,"date":"2014-08-26T18:40:31","date_gmt":"2014-08-26T18:40:31","guid":{"rendered":"http:\/\/www.dognmonkey.com\/techs\/?p=4004"},"modified":"2014-08-26T21:39:44","modified_gmt":"2014-08-26T21:39:44","slug":"how-to-set-up-java-programming-on-windows","status":"publish","type":"post","link":"https:\/\/www.dognmonkey.com\/techs\/how-to-set-up-java-programming-on-windows.html","title":{"rendered":"How To Set Up Java Programming On Windows"},"content":{"rendered":"<p style=\"text-align: center;\"><em>So I want to write java programs on Windows, besides writing codes, I have to be able to compile and test the programs, there are a few steps that need to be done before I could really do it without errors.<\/em><\/p>\n<p style=\"text-align: center;\"><em>I needed <a title=\"jdk8 download\" href=\"\/\/www.oracle.com\/technetwork\/java\/javase\/downloads\/index.html\" target=\"_blank\">Java SE Development Kit JDK 8<\/a>, download and install. I use <a title=\"notepad++ download\" href=\"\/\/notepad-plus-plus.org\/\" target=\"_blank\">notepadd++<\/a> to write codes.<\/em><\/p>\n<p style=\"text-align: center;\"><em>Now, Windows doesn&#8217;t know where javac or path of the program are, I have to set them or I&#8217;ll get all the errors. Using cmd windows and set the path. At the prompt:<\/em><\/p>\n<blockquote>\n<p style=\"text-align: left;\"><em>set path=&#8221;C:\\Program Files\\Java\\jdk1.8.0_20\\bin&#8221;<\/em><\/p>\n<p style=\"text-align: left;\"><em>set classpath=%classpath%;.; \/\/don&#8217;t forget the little &#8220;.&#8221; between ;;<\/em><\/p>\n<\/blockquote>\n<p style=\"text-align: center;\"><a class=\"preview\" href=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/javabin.jpg\" rel=\"lightbox[java]\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4005\" src=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/javabin-300x126.jpg\" alt=\"java bin folder\" width=\"250\" height=\"105\" srcset=\"https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/javabin-300x126.jpg 300w, https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/javabin.jpg 790w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a>\u00a0 \u00a0 \u00a0<a class=\"preview\" href=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/javatxt.jpg\" rel=\"lightbox[java]\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4007\" src=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/javatxt-300x130.jpg\" alt=\"javatxt\" width=\"250\" height=\"108\" srcset=\"https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/javatxt-300x130.jpg 300w, https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/javatxt.jpg 548w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><em>So, I used notepad++ to create a program call HelloWorld.java in my portable drive J:\\java\\programs\\ with the content:<\/em><\/p>\n<blockquote>\n<p style=\"text-align: left;\">public class HelloWorld {<br \/>\npublic static void main(String[] args) {<br \/>\nSystem.out.println(&#8220;Hello World.&#8221;);<br \/>\n}<br \/>\n}<\/p>\n<\/blockquote>\n<p style=\"text-align: center;\"><em>Now I can compile the program with &#8220;javac HelloWorld.java&#8221;<\/em><\/p>\n<p style=\"text-align: center;\"><i>Below is the screen shot of all the problems before I set the path of java and classpath.<\/i><\/p>\n<p style=\"text-align: center;\"><a class=\"preview\" href=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/javaprogramming.jpg\" rel=\"lightbox[java]\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4006\" src=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/javaprogramming-207x300.jpg\" alt=\"javaprogramming errors\" width=\"207\" height=\"300\" srcset=\"https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/javaprogramming-207x300.jpg 207w, https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/javaprogramming.jpg 641w\" sizes=\"auto, (max-width: 207px) 100vw, 207px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><em>Now the path is set temporarily, I need to set the path and classpath permanently so I don&#8217;t have to type every time.<\/em><\/p>\n<p style=\"text-align: center;\"><em>Right-click mycomputer &#8211;&gt;properties&#8211;&gt;system protection&#8211;&gt;advanced&#8211;&gt;Environment Variables and add PATH and CLASSPATH with the java sdk bin address with &#8220;;&#8221;\u00a0<\/em><\/p>\n<p style=\"text-align: center;\"><em>Add PATH<\/em><\/p>\n<p style=\"text-align: center;\"><a class=\"preview\" href=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent.jpg\" rel=\"lightbox[java]\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4011\" src=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent-300x151.jpg\" alt=\"Computer Properties\" width=\"250\" height=\"126\" srcset=\"https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent-300x151.jpg 300w, https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent.jpg 570w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a>\u00a0 \u00a0 \u00a0<a class=\"preview\" href=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent1.jpg\" rel=\"lightbox[java]\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4012\" src=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent1-265x300.jpg\" alt=\"System Protection Advanced\" width=\"221\" height=\"250\" srcset=\"https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent1-265x300.jpg 265w, https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent1.jpg 421w\" sizes=\"auto, (max-width: 221px) 100vw, 221px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><a class=\"preview\" href=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent2.jpg\" rel=\"lightbox[java]\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4013\" src=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent2-253x300.jpg\" alt=\"Add New Variable &quot;PATH&quot;\" width=\"250\" height=\"296\" srcset=\"https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent2-253x300.jpg 253w, https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent2.jpg 416w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a>\u00a0 \u00a0 \u00a0<a class=\"preview\" href=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent3.jpg\" rel=\"lightbox[java]\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4014\" src=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent3-246x300.jpg\" alt=\"PATH Variable\" width=\"246\" height=\"300\" srcset=\"https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent3-246x300.jpg 246w, https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent3.jpg 410w\" sizes=\"auto, (max-width: 246px) 100vw, 246px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><em>Add CLASSPATH<\/em><\/p>\n<p style=\"text-align: center;\"><a class=\"preview\" href=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent4.jpg\" rel=\"lightbox[java]\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4015\" src=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent4-257x300.jpg\" alt=\"CLASSPATH Variable\" width=\"250\" height=\"292\" srcset=\"https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent4-257x300.jpg 257w, https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent4.jpg 413w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a>\u00a0 \u00a0 \u00a0<a class=\"preview\" href=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent5.jpg\" rel=\"lightbox[java]\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4016\" src=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent5-258x300.jpg\" alt=\"PATH and CLASSPATH Variables\" width=\"250\" height=\"291\" srcset=\"https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent5-258x300.jpg 258w, https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent5.jpg 414w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><em>No more setting PATH or CLASSPATH<\/em><\/p>\n<p style=\"text-align: center;\"><a class=\"preview\" href=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent6.jpg\" rel=\"lightbox[java]\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4017\" src=\"\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent6-300x119.jpg\" alt=\"PATH and CLASSPATH permanent\" width=\"300\" height=\"119\" srcset=\"https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent6-300x119.jpg 300w, https:\/\/www.dognmonkey.com\/techs\/wp-content\/uploads\/2014\/08\/setpathpermanent6.jpg 544w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><iframe loading=\"lazy\" src=\"\/\/www.youtube.com\/embed\/y8-Ow7b_GO4?rel=0\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p style=\"text-align: center;\"><a title=\"java introduction\" href=\"\/\/introcs.cs.princeton.edu\/java\/home\/\" target=\"_blank\"><em>Nice tutorial for java is here.<\/em><\/a><\/p>\n<p style=\"text-align: center;\"><ul class=\"lcp_catlist\" id=\"lcp_instance_0\"><\/ul><\/p>\n","protected":false},"excerpt":{"rendered":"<p>So I want to write java programs on Windows, besides writing codes, I have to be able to compile and test the programs, there are a few steps that need to be done before I could really do it without errors. I needed Java SE Development Kit JDK 8, download and install. I use notepadd++ <a href=\"https:\/\/www.dognmonkey.com\/techs\/how-to-set-up-java-programming-on-windows.html\" class=\"more-link\">&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[511],"tags":[514,512,513],"class_list":["post-4004","post","type-post","status-publish","format-standard","hentry","category-java","tag-java-se","tag-java-windows","tag-jdk-8"],"views":350,"_links":{"self":[{"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/posts\/4004","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/comments?post=4004"}],"version-history":[{"count":5,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/posts\/4004\/revisions"}],"predecessor-version":[{"id":4019,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/posts\/4004\/revisions\/4019"}],"wp:attachment":[{"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/media?parent=4004"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/categories?post=4004"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dognmonkey.com\/techs\/wp-json\/wp\/v2\/tags?post=4004"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}