You can tweak you windows registry to use same command to open jar wile, but normally windows use "javaw -jar HelloWorld.jar" command to open jar. So I had to change the main program install to no longer do a silent install, and also clean up my file associations. My problem is that the command line was cut and pasted out of Outlook. User is set to run wheter logged in or not. check over here
JDK 6) but an old version of JRE (e.g. Hey Javin,Thanks a lot. For our purpose we will use following HelloWorld program for our testing, interestingly I have named it HelloHP and it resides in a package called "dto". Here's for your reference a mapping of java versions to major.minor versions: Java Version Major Version Java 1.1 45.0 Java 1.2 46.0 Java 1.3 47.0 Java 1.4 48.0
It wiil be in a long list of all the extensions that windows knows about. I'm assuming if I could figure out how that's becoming the name of the main class it's looking for, then I could solve the problem. –aardvarkk Mar 25 '11 at 3:15 But if you think it is possible, feel free to write your own answer. –Stephen C Mar 15 at 13:02 | show 15 more comments up vote 93 down vote If
The MANIFEST.MF file is case-sensitive. Thank you so very much in advance! The main class is "pkgLib.ProgABDriver". ... Could Not Find Or Load Main Class Jar Maven October 25, 2015 at 11:19 AM Javin Paul said... @raghu, what error are you getting, can you post your error here?
My goal is not just to give you solution but also make you able to explain why the solution is working and CLASSPATH basics are very important for a Java developer. Error Could Not Find Or Load Main Class Jar Linux For example, a working MANIFEST.MF file, would fully look like this: Manifest-Version: 1.0 Class-Path: . Also, make sure you follow issue 2, and that the default program for opening .jar files is java.exe Leave comments on new problems that occur, and any fixed problems. I had to completely delete the association, not just the user customisation, and reinstall the JRE.
Now let's run the program target directory first without using -classpath option: C:\Users\WINDOWS 8\workspace\Demo\target\classes>cd .. Error Could Not Find Or Load Main Class Java Join them; it only takes a minute: Sign up .jar error - could not find or load main class up vote 15 down vote favorite 2 I tried to put HelloWorld share|improve this answer answered Feb 13 '14 at 16:51 Blrp 4231522 add a comment| Did you find this question interesting? Head to source then clean up and stick with the default settings and on Finish.
Or you have a keyboard with special characters? I really hate it when the simple things go wrong... –aardvarkk Mar 25 '11 at 15:08 This is strange because i have the same problem, but it differs the Could Not Find Or Load Main Class Jar File Join them; it only takes a minute: Sign up “Could not find the main class” when double-clicking .jar file up vote 25 down vote favorite 9 First: I realize that this Could Not Find Or Load Main Class While Executing Jar File The text of the output is different.
Try the following steps, hopefully that might help : Considering that your directory structure looks like this : TicTacToe(Your Project Name I mean) | | | src bin manifest.txt | | check my blog share|improve this answer answered Oct 24 at 22:19 shieldgenerator7 502310 add a comment| up vote -2 down vote From the option menu, select Project->Clean and then select your project and click add the jar files into your project from the jarAddOns folder (previously saved in safe location) project buildpath and add jars and apply now run the project it should not show By the way, there are more to it e.g. Jar Cannot Find Main Class
This Question is about Java programs, not ordinary executables. should) know enough to tell you that the source file is in the wrong place. –Stephen C Sep 14 at 22:43 I was using Atom and javac on Linux I´ve just written an example. http://gsbook.org/not-find/jar-file-could-not-find-the-main-class.php It's Java class loader who looked into CLASSPATH for loading classes.
Open command and see if it looks a little like what I posted in #8. Executable Jar Could Not Find The Main Class Here is the registry contents for .jar files on my XP machine: [HKEY_CLASSES_ROOT\jarfile\shell\open\command] @="\"C:\\Program Files\\Java\\jre1.6.0_07\\bin\\javaw.exe\" -jar \"%1\" %*" 03-02-2012,09:02 PM #9 DiciWales Member Join Date Mar 2012 Posts 22 Rep Power leading to the odd situation that wasted your time. –Stephen C Sep 15 at 2:50 add a comment| up vote 0 down vote I got same error while starting webapp server
Had to change the lines in .classpath from
Under that name will be shell and command. I debug it by debug as Java program and found that it was one of the dependent JAR which was available in classpath but Eclipse was not seeing it. Running from outside the package did the job for me, thanks! http://gsbook.org/not-find/jar-could-not-find-the-main-class-bluej.php I hope this answer speeds up someone else's search, a comment like this could have saved me a bit of time.
Precisely. Thanks for any direction you can give me, I'm tearin' my hair out here! Maybe its empty or maybe it´s a wrong path and so on, the application cannot find java class. In short, on average they DON'T help. –Stephen C Mar 8 '15 at 4:50 6 cd-ing back to the root folder of the java package was exactly the one solution
Hello Javier, by scheduled task do you mean running your Java program as windows service? Thanks. –CodeBlue May 4 '12 at 15:20 add a comment| up vote 1 down vote search your regedit and check follow item Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Applications\javaw.exe\shell\open\command] @="\"C:\\Program Files (x86)\\Java\\jre6\\bin\\javaw.exe\" At the command prompt, try running ftype | find "jarfile" On my 64-bit Windows 7 computer, that shows jarfile="C:\Program Files (x86)\Java\jre6\bin\javaw.exe" -jar "%1" %* You can also change it with ftype: Other References From the Oracle Java Tutorials - Common Problems (and Their Solutions) From the Java Documentation: The Java Command - 'java' and 'javaw' The Classpath share|improve this answer edited Dec
In the first screenshot (please post text instead in future) you can see the main class appears to have an unusual spelling; is this in the manifest file? Under that name will be shell and command. I keep getting the message: " Could not find the main class. com.ClassName, I think I have discussed this in the article as well.
That's most likely because your Main is not in the JAR file. -cp lib.jar; means the same thing as -cp lib.jar;. To do this, just create a file called manifest.txt and add the following contents: Main-Class: com.benohead.app.Main Replace com.benohead.app.Main by the fully qualified name of your main class (the class containing the To fix this, there are multiple steps. Regex with sed command to parse json text What does the author want to convey by ending his letter with »Tschüssikowsky«?
I'll update my answer to cover that case. –Stephen C Nov 2 '13 at 0:13 @StephenC and EduardoDennis, It was that here too, there was a jar missing, that