Error Could Not Find The Main Class Program Will Exit
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and could not find the main class program will exit eclipse policies of this site About Us Learn more about Stack Overflow the could not find the main class program will exit oracle installation company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags
Could Not Find The Main Class Program Will Exit Jar File
Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only
Could Not Find The Main Class Program Will Exit Ant Eclipse
takes a minute: Sign up Could not find the main class: Program will exit up vote 1 down vote favorite 1 When attempting to compile and run my program in Eclipse SDK this error pops up. Ive never encountered this error message before and other posts are not very helpful. What could cause this? java compiler-errors share|improve this question asked May could not find the main class program will exit minecraft 1 '12 at 20:37 Matt 32114 1 Post the relevant code and the stack trace of the error. –Bernard May 1 '12 at 20:39 11 With this plethora of details you added, this post is not helpful, too. –joni May 1 '12 at 20:40 1 @Matt: You state in a comment to one of the answers that you found a solution. As requested there, please accept an answer. If your solution was not covered by one of the answers, you can answer the question yourself and then accept that answer. –GreenMatt Jul 12 '12 at 19:57 add a comment| 13 Answers 13 active oldest votes up vote 8 down vote If you have a main() method and are still receiving this, the error can also appear as part of a thread error if you are also receiving a noclassdeffound error. If this is a new issue with an existing program that you have had success with before then it may be because there was a compiling error made. Delete out the compiled jar file and recompile. sha
This Site Careers Other all forums Forum: Beginning Java Error: Could not find the main class. Program will exit. Niraj Chaudhary Greenhorn Posts: 5 posted 5 years ago Hi, I have a java application
Could Not Find The Main Class Program Will Exit Java
that is started from an executable. When I try to run that, This could not find the main class program will exit java virtual machine launcher error pops up "Title: Java Virtual Machine Launcher" saying "Could not find the main class. Program will exit." This error could not find main class program will exit executable jar is coming when the application is tried to run on some machines (that's what I think), and not for all the users. Following are the steps that have been suggested, but the error http://stackoverflow.com/questions/10404001/could-not-find-the-main-class-program-will-exit still persists: 1.Uninstall any older/ multiple versions of java from the Windows machine and keep only the latest one. 2.Point the environment variable "CLASSPATH" to the directory where "java" is present, and also to the main class of my application. 3.Try installing the tool on a different machine (in the same network domain). I have seen many posts in this and other forums on this topic, https://coderanch.com/t/526005/java/java/Error-find-main-class-Program and the solutions suggested above have been taken from them, but the solution for my problem here is not there. It may be a trivial mistake or something else, but please help me out, as I am only a beginner in trying to solve such problems. Also, if you can please tell me how do I get this error, on my machine, that would be great? Something to understand the steps causing the problem. I don't get the error pop-up on my system. Thank you so very much in advance! Campbell Ritchie Sheriff Posts: 50429 82 posted 5 years ago Welcome to the Ranch Any suggestions about setting a CLASSPATH are likely to be unhelpful. In fact a system CLASSPATH can do more harm than good. The sort of error you quote suggests you have nothing wrong with the Java™ installation, but there is a problem with your own file. You are not clear about what you are running. Are you running a .jar or a .exe? If a .jar, what is in its manifest file? Please print that out. What is the fully-qualified name of the class with the main mathod in? Niraj C
CommunityMarketplaceEventsPlanet EclipseNewsletterVideosParticipateReport a BugForumsMailing ListsWikiIRCHow to ContributeWorking GroupsAutomotiveInternet of ThingsLocationTechLong-Term SupportPolarSysScienceOpenMDM Toggle navigation Bugzilla – Bug421423 Could not find the main class. Program will exit. On Luna. Last modified: 2016-02-29 04:43:03 EST Home | New | Browse | Search | [?] | Reports | Requests | Help https://bugs.eclipse.org/bugs/show_bug.cgi?id=421423 | Log In [x] | Forgot Password Login: [x] | Terms of Use | Copyright Agent First Last Prev Next This bug is not in your last search results. Bug421423 - http://www.herrodius.com/blog/42 Could not find the main class. Program will exit. On Luna. Summary: Could not find the main class. Program will exit. On Luna. Status: VERIFIED FIXED Product: Platform Classification: Eclipse Component: Ant could not Version: 4.3 Hardware: PC Windows Vista Importance: P3 normal (vote) TargetMilestone: 4.5 M7 Assigned To: Sarika Sinha Back on 17th Oct QA Contact: URL: Whiteboard: Keywords: Depends on: Blocks: Show dependency tree Reported: 2013-11-11 02:10 EST by Ed Willink Modified: 2016-02-29 04:43 EST (History) CC List: 6 users (show) dan.dragut jarthana lbarbareau lshanmug Michael_Rennie squall_J See Also: Flags: Michael_Rennie: review+ Attachments could not find Expose version check method in JDT (1.74 KB, patch) 2015-01-29 05:01 EST, Sarika Sinha Back on 17th Oct no flags Details | Diff Version check before launching (4.71 KB, patch) 2015-01-29 05:04 EST, Sarika Sinha Back on 17th Oct no flags Details | Diff Expose version check method in JDT (2.52 KB, patch) 2015-02-04 04:11 EST, Sarika Sinha Back on 17th Oct no flags Details | Diff Version check before launching (5.32 KB, patch) 2015-02-04 04:13 EST, Sarika Sinha Back on 17th Oct no flags Details | Diff Alternate approach (7.85 KB, patch) 2015-03-23 11:26 EDT, Michael Rennie no flags Details | Diff Shows a proper message for unsupported Java version (7.80 KB, patch) 2015-04-17 02:49 EDT, Sarika Sinha Back on 17th Oct no flags Details | Diff Show Obsolete (5) View All Add an attachment (proposed patch, testcase, etc.) Note You need to log in before you can comment on or make changes to this bug. Description Ed Willink 2013-11-11 02:10:12 EST Luna finally discontinues all practical support for Java 5, so any legacy launch configuration that specifies a Java 5 VM now fails with Could not f
5) and couldn't run my ANT builds anymore. The error I got in the alert box was "Could not find the main class. Program will exit". The problem was that the ANT_HOME variable was still pointing to the previous Eclipse folder and the solution was simply to change the path. This can be done through Window->Preferences->Ant->Runtime. Once there, click the "Ant home…" button in the "Classpath" tab and browse to the ANT plugin folder in your Eclipse installation. Now hit the OK button and try to run the build file again. Everything should work again. Add to Bloglines - Digg This! - del.icio.us - Stumble It! - Twit This! - Technorati links - Share on Facebook - Feedburner 78 Responses to ""Could not find the main class. Program will exit."" David Tarico Says: February 24th, 2006 at 2:31 am Thanks tons! I was having the same problem and even though it was trivial to fix, the hard part was figuring out what the problem was and where to go to fix it. I'm always thankful when altruistic people such as yourself post solutions to their problems. joc Says: March 24th, 2006 at 3:49 pm I can only aggre with Daid Tarico. Thanks for descriping and reporting Rahul Says: April 10th, 2006 at 8:19 am Thanks Christophe, It was so simple, but didn't got noticed Aigloss Says: May 12th, 2006 at 3:49 pm Just want to say Thanx for such an easy solution!!!! Brian Says: May 25th, 2006 at 1:42 am I get the same problem, but your solution did not work for me. The ANT HOME is set correctly. Any other ideas??????? TIA Brian Brian Says: May 25th, 2006 at 2:06 am I had to get ANT out of my PATH before I ran eclipse to make this work. De Wet Says: June 6th, 2006 at 12:15 pm i had the same problem but it was just that one second it worked and the next it didnt. Well not exactly, I added the sun fscontext.jar and providerutil.jar files to my project and then eclipse w