{"id":1927,"date":"2017-12-06T11:57:53","date_gmt":"2017-12-06T11:57:53","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=1927"},"modified":"2021-11-18T09:28:12","modified_gmt":"2021-11-18T09:28:12","slug":"maven","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/maven\/","title":{"rendered":"Maven"},"content":{"rendered":"<p><strong>swatinikam2009 created the topic: Maven<\/strong><br>\nHi ,<\/p>\n<p>I am trying to run java code. I have set the environment correctly. Also created MAVEN_HOME variable and added it to path varibale.<br>\nBut still i am getting error message saying &#8220;count not find or load main class App&#8221;.<\/p>\n<p>What to do?<\/p>\n<p><strong>rajeshkumar replied the topic: Maven<\/strong><br>\nCheck with your java file main method or maven directory structure.<\/p>\n<p>Example<br>\n<a href=\"http:\/\/github.com\/scmgalaxy\/jacoco-maven-unittestv2\/\" target=\"_blank\" rel=\"noopener\">github.com\/scmgalaxy\/jacoco-maven-unittestv2\/<\/a><br>\nRegards,<br>\nRajesh Kumar<br>\nTwitt me @ <a href=\"http:\/\/twitter.com\/RajeshKumarIn\" target=\"_blank\" rel=\"noopener\">twitter.com\/RajeshKumarIn<\/a><\/p>\n<p><strong>swatinikam2009 replied the topic: Maven<\/strong><br>\nHi Rajesh,<\/p>\n<p>I have done all the settings proprly but still getting the error.<\/p>\n<p>So I tried to run code by followinf cmd.<\/p>\n<p>c:\\MavenDemos\\MyPro &gt; java -cp target\/classes com.acc.App<\/p>\n<p>And then it is showing me output.<\/p>\n<p>Can you please tell me. Where i am doing wrong?<\/p>\n<p><strong>swatinikam2009 replied the topic: Maven<\/strong><br>\nContiued with the above query.<\/p>\n<p>I have done one change. And then it is working fine . No need to use c:\\MavenDemos\\MyPro&gt;java -cp target\/classes com.acc.App<\/p>\n<p>I have removed CLASSPATH variable from user variable in Env. variables.<\/p>\n<p>Then it is working fine. so now i just type c:\\MavenDemos\\MyPro\\target\\classes&gt;java com.acc.App<\/p>\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_31111\"><iframe loading=\"lazy\"  id=\"_ytid_36484\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_31111\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>swatinikam2009 created the topic: Maven Hi , I am trying to run java code. I have set the environment correctly. Also created MAVEN_HOME variable and added it to path varibale&#8230;. <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[29],"tags":[161],"class_list":["post-1927","post","type-post","status-publish","format-standard","hentry","category-maven","tag-maven"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1927","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=1927"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1927\/revisions"}],"predecessor-version":[{"id":25727,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1927\/revisions\/25727"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=1927"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=1927"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=1927"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}