So, I had deleted main method from subsequent classes. Thanks! Simpson 243320 If you used an IDE or a Java build tool you most likely would not get into this problem The compiler would (or at least ... I am running Fedora (Linux). check over here
share|improve this answer answered Dec 22 '15 at 4:47 Vinay 9017 add a comment| up vote 0 down vote This solved the issue for me today: cd /path/to/project cd build rm Error: A fatal exception has occurred.Program will exit. That's why I keep getting "could not find or load main class" and "could not find symbol" when they are right in the current directory. from the current directory that is in effect when you run the java command.
Browse other questions tagged java class main or ask your own question. So just type the command java in your command prompt and see what the output is shown. Sign in to make your opinion count. tportguides 37,807 views 9:06 Java set the path in windows 7.wmv - Duration: 5:11.
learnAsABeginner 15,601 views 8:03 Setting Path and Classpath for Java in Windows 7 - Duration: 6:01. eHowTech 18,778 views 2:01 Excel VBA Introduction Part 35 - Class Modules - Duration: 59:32. So let's correct this error and try to run the same command from the same location but this time with fully qualified name: C:\Users\WINDOWS 8\workspace\Demo\target\classes\dto>java dto.HelloHP Error: Could not find or Could Not Find Or Load Main Class Helloworld This is permanent soultion.
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? Error: Could Not Find Or Load Main Class Jar I commented out the package statement in the source and added "-cp ." to the java command. If the class is called Hello, you must not try hello, because Java is case-sensitive. TechZone++ 15,455 views 10:05 Tutorial on how to make a Java JAR file with the command prompt - Duration: 4:34.
The compilation wasn't the issue but the running of the main file in a child directory, is. Could Not Find Or Load Main Class Maven There will be other errors and exceptions (NullPionter for example) but you will not see "Coud not find or load main class" as long as main class is found and loaded. It will help if the class tree containing the classes in the current directory. Add to Want to watch this again later?
Try installing new JRE/JDK share|improve this answer answered Nov 11 '11 at 7:26 Shaddu 611 add a comment| up vote 4 down vote I know this question was tagged with linux, Sign in to add this video to a playlist. Could Not Find Or Load Main Class Eclipse Call that method passing it the command line arguments ("fred", "joe", "bert") as a String. Error: Could Not Find Or Load Main Class Linux WiseOwlTutorials 30,854 views 59:32 How to Fix "Could not find main class: GUI" On RSPS [HD] - Duration: 6:39.
Sign in Share More Report Need to report the video? http://toriisoft.com/could-not/java-error-could-not-find-or-load-main-class.html I have been wading through tons of Java doc and this concrete example is what I needed –user2044223 Mar 17 '15 at 19:05 Its better to make 'Runnable JAR Working... stackoverflow.com/a/6069764/565661 –RamNat Nov 19 '14 at 22:06 how to do this in STS with same error? –vbNewbie Nov 23 '14 at 19:21 4 This error occurs when you Error: Could Not Find Or Load Main Class Netbeans
Loading... In my case I created my project in Eclipse which defaults to src (rather than src/main/java/. For example, if you have previously set up an Application Launcher for your Java app in Eclipse, and you then moved the JAR file containing the "main" class to a different http://toriisoft.com/could-not/java-error-could-not-find-the-main-class.html It's only from JDK 1.7 onward we are started receiving this new error.
Windows (tested with 7) doesn't accept special characters (like á) in class and package names. Error: Could Not Find Or Load Main Class Scala InterviewDot Job 4,399 views 2:55 how to fix java "system cannot find the path specified" easy tutorial 2015 - Duration: 2:58. But if you think it is possible, feel free to write your own answer. –Stephen C Mar 15 at 13:02 | show 14 more comments up vote 90 down vote If
October 25, 2015 at 11:19 AM Javin Paul said... @raghu, what error are you getting, can you post your error here? In order to understand the problem little better, let's reproduce it. The other problem is that your instruction to "cd to the source directory" only works if you compiled the code >>into<< the source directory tree. Error: Could Not Find Or Load Main Class Mac more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed
JavaProgrammers 1,903 views 12:22 How To Compile And Run A Java Source File With Javac On Command Prompt (cmd) - Duration: 9:06. share|improve this answer answered Mar 12 '14 at 0:37 KawaiKx 2,09363147 Yes. java class main share|improve this question edited May 18 '14 at 17:34 gturri 4,81452038 asked Aug 7 '13 at 3:02 Stephen C 395k47421750 4 Please note that this is a have a peek at these guys I get an error could not find or load main class in my code how to fix it can anyone help me October 14, 2016 at 6:59 AM Post a Comment
The people who might concievably act on your complaints won't notice it. share|improve this answer answered Oct 24 '15 at 21:18 Nenad Bulatovic 2,60153857 This advice may or may not help. Working... Really my point is that your answer is adding nothing new ...
The problem was that >>you<< narrowed in on the wrong clause.) –Stephen C Nov 7 at 22:42 @StephenC what I meant is, they surely have access to the information Watch QueueQueueWatch QueueQueue Remove allDisconnect The next video is startingstop Loading... the right class name, but in the wrong form.) Considering the example above, here a variety of wrong ways to specify the class name: Example #1 - a simple class name: Did you? –Stephen C Mar 17 '15 at 22:36 1 @Ali.Rashidi - There are lots of other short answers.
StephenC, yours lacks the simple package example I needed as I am new to Java. –kmort Oct 29 '14 at 19:02 This was exactly my problem. Up next Error Could not find or load main class - Duration: 7:42. Server is the main class, contains main() method but somehow Eclipse is not able to find it. Pentest Results: Questionable CSRF Attack Is it OK to lie to a customer to protect them from themselves?
© Copyright 2017 toriisoft.com. All rights reserved.