Error: Could Not Find or Load Main Class

Posted on

Java is the computer programming language which class based, object oriented and specifically designed to create the implementation dependencies as possible as. In fact, Java is one of the most popular programming language which used by many developers. Especially, it often use to client server applications. Sometime, there are the problems which can occur in Java. One of the most common problems is the error message which displayed “Could not find or load main class”. Have you ever got this error message? Do you know what the solution to fix this error? Actually, this error is not serious problem. So you can fix it easily by yourself. There is the method to find out the solution of this error.

Well, at the moment, in this article we will explain the method to fix the error message: “Could not find or load main class”. If you are experiencing this problem, you can follow the instruction step by step in the following text. Once Java cannot find the main class, you can solve this problem by several steps. At first you have to make sure that you add the location of your class file to the specified classpath. In this step, you will need to use your preferences of IDE. Here is the step if you are using Eclipse, please follow it steps by step.

  1. At first you have to go to “Project”.
  2. Then you can go to “Properties”.
  3. After that you can select “Java Build Path”.
  4. The next step, please select “Add Class Folder”.

In a case, what do we do when class in a package? If you find that your class in a package so can try the below command:

java – classpath thepackagename TheClassName

There are two different types of Classpath separators. For Linux it is a colon, than for Windows it is a semicolon. In fact, there are many other different in Linux and Windows. If you want to know more about the differences among Linux and Windows Java codes, so you can search for its explanation in other website. There are many sites which explain the material about the differences among Linux and Windows Java codes.

VIDEO

Once we talk about Java, we remind to Javascript. Actually Java is different from Javascript. Sometime, there are many people who are confused whether Java is Javascript. The answer, of course Java is not same with Javascript. As we know that Javascript is one of the three core technologies of the World Wide Web content production. It is the programming language of HTML and Web which is a high level, dynamic and interpreted. Now almost all web pages contain Javascript. It makes the web pages interactive and provides the online programs. Javascript is one of the three languages which should learn by all web developers because it is very important and it used to program the behavior of web pages. Of course, the web developers also have to learn other languages such as HTML and CSS.

Leave a Reply

Your email address will not be published. Required fields are marked *