Could Not Find Main Class Jar Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads error could not find or load main class jar with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack error could not find or load main class jar hadoop Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign error could not find or load main class jar eclipse up “Could not find the main class” error when running jar exported by Eclipse up vote 15 down vote favorite 9 I have a java project that works perfectly fine when running it from within Eclipse. When I try to export error could not find or load main class jar linux it to either a "JAR file" or "Runnable JAR file" the .jar file is created, but when I double click on it to try to run the program it gives me an error that says "Could not find the main class: package.MainClassName. Program will exit." As I mentioned, I tried exporting to both JAR options, I specified the correct class that the main method is in, and when I look through the actual files in the .jar file everything seems to be in
Error Could Not Find Or Load Main Class Jar File
order -- the manifest looks something like: Manifest-Version: 1.0 Main-Class: package.MainClassName (blank line) and is in the META-INF folder. There is a folder with my package name, which contains all the .class files, including the class that contains the main method. A few image and text files that I use also appear in the jar file. The actual program isn't anything too complicated -- it's a simple "snake" game using Swing (plus the code all works when run from inside Eclipse). Any ideas what is causing this error and how I can fix it? Let me know if there's any other information I should provide. java eclipse swing jar executable-jar share|improve this question edited Mar 8 '12 at 6:10 asked Mar 8 '12 at 4:32 scaevity 1,38672446 What is the fully qualified name of the main class? Is it package.MainClassName or something else? –Jim Garrison Mar 8 '12 at 4:50 it's snake.Controller. –scaevity Mar 8 '12 at 4:52 Manifesto is a convenient way to examine your manifest in place. –trashgod Mar 8 '12 at 5:27 @trashgod what exactly does Manifesto do that just looking at the manifest does not? –scaevity Mar 8 '12 at 6:06 @scae: Just convenience; it shows the manifest as it actually appears in the JAR, without having to extract the contents. –trashgod Mar 8 '12 at 11:31 | show 2 more comments 6 Answers 6 active oldest votes up vote 12 down vote Ve
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about
Could Not Find Main Class Jar Executable
Stack Overflow the company Business Learn more about hiring developers or posting ads with could not find or load main class jar maven us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is java jar could not find the main class a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up JAR file: Could not find main class up vote 2 down vote favorite Okay, http://stackoverflow.com/questions/9612918/could-not-find-the-main-class-error-when-running-jar-exported-by-eclipse I have a strange problem. I wanted to run one of my programs as a .jar file, but when I open it by double-clicking it, I get an error message like "Could not find main class, program is shutting down". I'm pretty sure I did everything right, the jar should work afaik. I also tried other programs, it's the same with every single one. (I'm creating the .jar's through BlueJ) http://stackoverflow.com/questions/10149463/jar-file-could-not-find-main-class There is no problem when I run them through a .bat . And here comes the strangest thing of all: The .jar's have worked some time ago (one or two months I guess), and I don't remember doing anything different. It's the same BlueJ-Version. Okay, maybe Java updated and something got messed up... I googled, but I couldn't find a solution. (some people seem to have a similar problem, and it seems to be only them who can't run their .jar's; they uploaded them and other people say the .jar's run fine.) What could be the problem? How can I solve it? I'd really appreciate some help here. Thank you :) ApertureT3CH EDIT: okay guys, you're making me unsure here. Imma check the manifest again, at this unholy time ( 1:34 am ) :P EDIT2: This is my MANIFEST.MF Manifest-Version: 1.0 Class-Path: Main-Class: LocalChatClientGUI [empty line] [empty line] The Main class is correct. EDIT3: Thanks to hgrey: There is nothing wrong with the jar. I can run it from a bat file, which actually should not be different from double-clicking the jar, right? Yet I get the error when clicking it, and it works fine through the bat. EDIT4: I finally solved the problem. I re-installed the J
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss http://stackoverflow.com/questions/8629412/generated-runnable-jar-could-not-find-the-main-class the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow http://gatkforums.broadinstitute.org/gatk/discussion/5973/could-not-find-or-load-main-class-but-my-classpath-looks-correct Questions Jobs Documentation Tags 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 could not each other. Join them; it only takes a minute: Sign up Generated Runnable jar: Could not find the main class up vote 3 down vote favorite I've always used the Export -> Runnable jar option of Eclipse and it has worked perfectly, but today it seems that all the Runnable jars I create produce the following error when could not find I run them: (Edit: run them by double clicking the file.) Java Virtual Machide Launcher Could not find the main class: (class). Program will exit. I've tried everything for the past two hours, but it still doesn't work. I can still run jars that I have created in the past without a problem. The manifest file looks exactly the same as in those jars that work and all the .class files seem to be in place... I've tried exporting with Package required libraries into generated jar but the file still doesn't work. It doesn't show the error though - double clicking the file does nothing. Edit: Running the jar file through the cmd works perfectly, but simply double clicking on it yields this error. (Bragboy) Edit 2: Contents of a manifest file from a jar that works: (Obviously they're the same, just wanted to avoid confusion.) Manifest-Version: 1.0 Class-Path: . Main-Class: defender.DefenderComponent (+ two empty lines afterwards) And contents of a manifest file from a jar that doesn't work: (When opening t
team GATK Documentation Guide Tutorials FAQs Presentations Common Problems Methods and Algorithms Dictionary Pipelining with Queue Developer Zone Archive Tools related to GATK MuTect v1 MuTect v1 Documentation ReCapSeg ReCapSeg Documentation Oncotator Oncotator documentation GenomeSTRiP GenomeSTRiP Documentation XHMM Firepony Base Recalibrator search subcategories search archived Tags What to search discussions questions comments answers groups Date within 1 day 3 days 1 week 2 weeks 1 month 2 months 6 months 1 year of Examples: Monday, today, last week, Mar 26, 3/26/04 Search Howdy, Stranger! It looks like you're new here. If you want to get involved, click one of these buttons! Sign In Register Categories Recent Discussions Activity Best Of... Unanswered Groups Categories 6.4K All Categories184 Announcements 5.5K Ask the GATK team 205 GATK Documentation Guide 30 Tutorials 44 FAQs 12 Presentations 11 Common Problems 32 Methods and Algorithms 18 Dictionary 1 Pipelining with Queue 29 Developer Zone 28 Archive 450 Tools related to GATK 128 MuTect v1 11 ReCapSeg 36 Oncotator 246 GenomeSTRiP 26 XHMM 3 Firepony Base Recalibrator Powered by Vanilla. Made with Bootstrap. "Could not find or load main class", but my classpath looks correct jason.harris Menlo Park, CAPosts: 12Member ✭ August 2015 edited August 2015 in GenomeSTRiP Trying to run SVPreprocess; I am getting "Could not find or load main class" on the SVCommandLine class. My setup looks correct to me, so I am hoping for some advice. Sanity checks: $ java -version java version "1.7.0_02" Java(TM) SE Runtime Environment (build 1.7.0_02-b13) Java HotSpot(TM) 64-Bit Server VM (build 22.0-b10, mixed mode) $ echo ${SV_DIR} /nfs/projects/home/jharris/Code/svtoolkit $ java -jar ${SV_DIR}/lib/SVToolkit.jar SVToolkit version 2.00 (build 1602) Build date: 2015/07/21 09:43:14 Web site: http://www.broadinstitute.org/software/genomestrip unzip -v ${SV_DIR}/lib/SVToolkit.jar | grep SVCommandLine 8299 Defl:N 3874 53% 07-03-2015 11:16 c59d5638 org/broadinstit