Could Not Find The Main Class Error Jar
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings could not find or load main class jar and policies of this site About Us Learn more about Stack Overflow
Could Not Find Or Load Main Class Jar File
the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation
Could Not Find Or Load Main Class Jar Maven
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 each other. Join them; it
Could Not Find Or Load Main Class Eclipse
only takes a minute: Sign up JAR file: Could not find main class up vote 2 down vote favorite Okay, 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 could not find or load main class jar command line 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) 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
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 could not find or load main class while executing jar file about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges could not find main class jar executable Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each error could not find or load main class jar linux other. Join them; it only takes a minute: Sign up What does “Could not find or load main class” mean? up vote 365 down vote favorite 124 A common problem that new Java developers experience is that their http://stackoverflow.com/questions/10149463/jar-file-could-not-find-main-class programs fail to run with the error message: Could not find or load main class ... What does this mean, what causes it, and how should you fix it? java class main share|improve this question edited May 18 '14 at 17:34 gturri 4,73951937 asked Aug 7 '13 at 3:02 Stephen C 386k44409736 4 Please note that this is a "self-answer" question that is intended to be a generic reference Q&A for new Java users. I could not http://stackoverflow.com/questions/18093928/what-does-could-not-find-or-load-main-class-mean find an existing Q&A that covers this adequately (IMO). –Stephen C Aug 7 '13 at 3:21 this happened to me recently and it was due to a broken referenced library. I added an answer just in case it happens to someone else. –Eduardo Dennis Nov 1 '13 at 18:05 link <-- do you mind helping me? I tried debugging but to no avail. –Linify Jul 16 '14 at 3:45 2 Is your class under a package? if yes, see my answer –Razavi Oct 27 '14 at 12:09 2 In my case the answer was to add -jar –Nakilon Dec 15 '14 at 11:48 | show 1 more comment 24 Answers 24 active oldest votes up vote 396 down vote accepted The java
This Site Careers Other all forums Forum: Java in General Executable jar Could not find the main class Jo Young Ranch Hand Posts: 34 I like... posted 5 years ago I'm back... I've had this problem once https://coderanch.com/t/541296/java/java/Executable-jar-find-main-class already when I only had one class in the jar, I went back and http://gatkforums.broadinstitute.org/gatk/discussion/5973/could-not-find-or-load-main-class-but-my-classpath-looks-correct added a second class to make it user friendly because I realized that the way I wrote it originally in order for the user to turn off the program they would have to go into task manager and stop javaw.exe process... so I made a second class that has Swing on it and creates a window... could not and now it is having the problem of not being able to find the main class that is in the manifest again... and I have tried everything that I was directed to do the last time that finally got the other one fixed as well as all the different things that didnt work last time and it keeps giving me the same error... currently I have... C:\JarFile>C:\Oracle\Middleware1013\jdk160_18\bin\jar -tf PushupTimer.jar could not find META-INF/ META-INF/MANIFEST.MF myTimer.class timeClock.class C:\JarFile>C:\Oracle\Middleware1013\jdk160_18\bin\jar -xf PushupTimer.jar META-INF/MANIFEST.MF Manifest-Version: 1.0 Created-By: 1.6.0_18 (Sun Microsystems Inc.) Main-Class: myTimer any ideas? I tried setting Main-Class to Timer.myTimer and saving the class files to Timer.myTimer.class and Timer.timeClock.class (the package name for the classes is Timer so I thought that maybe having the files saved by just their class names and then it gets into the class and it is in a package might have been the problem... this was not the case) Jesper de Jong Java Cowboy Saloon Keeper Posts: 15495 43 I like... posted 5 years ago Maybe this is the problem: Make sure there is an empty line at the end of the MANIFEST.MF file. There's a known problem where Java will not interpret the last line in the manifest if there is no empty line at the end; the tutorial warns about this: The Java Tutorials wrote: Warning: The text file must end with a new line or carriage return. The last line will not be parsed properly if it does not end with a new line or carriage return. What error message exactly do you get when you enter the following command (please copy & paste the complete error message)? C:\Oracle\Middleware1013\jdk160_18\bin\java -jar PushupTimer.jar Java Begin
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/broadinstitute/sv/main/SVCommandLine.class Here is my command line: java -Xmx4g \ -cp ${SV_DIR}/lib/SVToolkit.jar:${SV_DIR}/lib/gatk/GenomeAnalysisTK.jar:${SV_DIR}/lib/gatk/Queue.jar \ org.broadinstitute.gatk.queue.QCommandLine \ -S ${SV_DIR}/qscript/SVQScript.q \ -S ${SV_DIR}/qscript/SVPreprocess.q \ -cp ${SV_DIR}/lib/SVToolkit.jar:${SV_DIR}/lib/gatk/GenomeAnalysisTK.jar:${SV_DIR}/lib/gatk/Queue.jar \ -gatk ${SV_DIR}/lib/gatk/GenomeAnalysisTK.jar \ -configFile ${SV