maven main class not found

Just make sure you’ve downloaded Binary zip archive(apache-maven-3.5.0-bin.zip) instead of Source zip archive. javascript – How to get relative image coordinate of this div? I am working with NetBeans. I finished my project and it worked fine. This worked for me. How to highlight a "risky" action by its icon, and make it stand out from other icons? In other words, it's only org.jis.Main. It needs also jcalendar.jar and jython.jar, but I think that I can found a way to use the Debian version instead of the ESRF jar files. Read more here: The mvn command, is a script. Make sure the access modifier is public and not private. I am getting a message that says "No main class found" when I try to run it. Finally, I found that maven I downloaded is Source zip archive. The response is a sheet file, how do I decode it and read it in springboot Java ? It look like that you have installed Source files(Because src only comes in Source Files and we don’t need it). Even though the question is answered I would like to add that, if you are getting the above mentioned error, be sure that you have downloaded the Binary file. Just by moving the position of /bin from M2_HOME to in front of the PATH, I had the same issue. In project properties, under the run tab, specify your main class. Exactly the same error may appear even with correct environment variable settings, if you copy ONLY bin directory to the installation directory. Thus, if you write: mvn install, what will happen: The problem is with (2). http://docs.oracle.com/javase/tutorial/getStarted/application/. The modifiers public and static can be written in either order (public static or static public), but the convention is to use public static as shown above. I have been working on an assignment for my class in programming. Maven 3.0.5 (Binary zip)) instead of complete source in official maven site. Try to install Binary Files from there. It could be that your main method does have the proper signature. java – Android HTML.fromHTML get output in one line – Stack Overflow, java – Decode Octet response from RestTemplate – Stack Overflow, java – How many results in these two programs and why? Package name without main.java in maven. This is not the whole code. At the end, you can easily test, which environment variable gone bad, and you can very easily fix your script (or set it what is needed). I'm afraid I haven't used NetBeans much, so I can't help you with where that option is. What I might be missing in this whole thing? Fortunately, this script is simply, very simple. I have had quite a share of people downloading the wrong file, seniors and juniors. i have fixed the others and now have just this one remaining. I came across a similar problem on my mac OSX. I have Windows xp box and when I would type mvn -version at the command line prompt I got the dreaded error message. By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy. I have read and tried all the solutions given at blogs such as : but still not able to get to it. You need to add }} to the end of your code. Issue was M2_HOME. On windows, it is a script called mvn.cmd and on linux, it is a shell script. Is it a good or a bad idea to use the Builder Pattern everywhere? Your email address will not be published. Steps that worked for me: Press the hammer to the left of the green arrow (run), for the program to clean & build project. Look for Main Class. When first a generic class is created and then the Main class is created Netbeans is registering the Main class and the app could be run and debugged. Famous grandmaster games of "torturous" winning or flaunting out of arrogance? Select Main Class. I noticed that Maven Source zip didn’t include any libraries at lib folder however Binary zip had them + in boot folder it had plexus-classworlds-2.4.jar. your coworkers to find and share information. By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service. I had the same problem with error “Could not find ...org.codehaus.plexus...“. Eg: unset M2_HOME. I went to that path via Explorer and sure enough there were files present. (Make sure to use the fully qualified name i.e. I have a feeling the throws declaration might be confusing it. On linux, you can debug shellscripts giving the -x flag to your shell interpreter (which is most probably bash). © 2014 - All Rights Reserved - Powered by, Maven error: Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher. Prior to this phase, you should notice that any .java file you have with a main() method within it will show up in the 'Projects' pane with its icon looking like this (no arrow): After this scanning phase finishes, if a main() method was discovered within the file, that file's icon will change to this (with arrow): So on my system, it appeared this "Scanning projects..." step was failing, and instead would be stuck on an "Opening Projects" step. Next to the maybe useful, but maybe too symptomatic answers, here is one which tries to help to find the cause of the problem. Next I tried the mvn –version command again, but this time I got back the expected results. Thank you though. Make sure you can see the %M2% and %JAVA_HOME% variables completely expanded, i.e. I keep having this problem and always that's my issue. Well, I had this problem and after seeing this post and particularly khmarbaise answer I noticed that M2_HOME was, I would like to mention that I use windows 7 (x64). When creating a new project - Maven - Java application in Netbeans the IDE is not recognizing the Main class on 1st class entry. Try to download binary zip (for ex. I ended up closing and reopening my project and it then found the main method. In the project properties I had to set the launch configurations to the file that contains the main-method (I don't know why it wasn't set to the right file automatically). 使用maven打包时,提示maven打包时,提示main class not found,解决方法:pom.xml中增加如下配置: org.springframework.boot spring-boot-maven-plugin