Unable to execute a java code in eclipse ide

58 Views Asked by At

Sample Code:

package pack.java;
import java.util.*;
public class Bye {
    public static void main(String args[]) {
    int a=3,b=5;
    System.out.println("The sum is:"+(a+b));
    }
}

I am unable to execute any code in the eclipse ide. I am getting an error. Error: Could not find or load main class pack.java.Bye Caused by: java.lang.ClassNotFoundException: pack.java.Bye

1

There are 1 best solutions below

0
Hime On
  • The ClassNotFoundException is thrown to indicate that the specified class cannot be found in the classpath. You have to check the classpath.
  • Still if it has not resolved and you are stuck then you can create a new workspace and start coding in it.