Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Could not find or load main class Main Caused by: java.lang.NoClassDefFoundError: com/company/Main (wrong name: Main)

//This probably means you need to change to the src directory
//and call 
java com.company.Main
Comment

error: could not find or load main class main caused by: java.lang.classnotfoundexception: main

//well, that means that ur main method doesn't exist, or your main method is out of your class.
//so, keep focusing in bracing part.
//main method should be like this:
Class main{
	public static void main(String[] args) {
	//ur code
	}
}


//hopefully this can help u :D
Comment

> Task :run FAILED Error: Could not find or load main class Caused by: java.lang.ClassNotFoundException:

Check your build.gradle file and update the application block:

application {
    // Define the main class for the application.
  	// insert the entire name of the class
    mainClassName = 'packageName.MainClass'
}
Comment

PREVIOUS NEXT
Code Example
Java :: java spring set private field in test 
Java :: How to get the nth Fibonacci number code in Java using recursion with memoization 
Java :: java print 2d array row and column 
Java :: Calendar ranges java 
Java :: overload and override in java 
Java :: java do while loop example 
Java :: bukkit random 
Java :: keep jframe on top 
Java :: how to create a console in java gui 
Java :: rename action bar android 
Java :: dowload htpasswd file java 
Java :: implements java 
Java :: what is use of drivermanager class 
Java :: how to run few methods of class after mockStatic 
Java :: Implementation of TreeMap Class in Java map 
Java :: is the function same as method in java 
Java :: org.springframework.security.oauth2.jwt.JwtEncoder 
Java :: java swing border 
Java :: spring boot api key authentication example 
Java :: java basic program 
Java :: Bukkit plugin player variable 
Java :: get sum of array and return string 
Java :: how to call a static method in java 
Java :: java double to string fixed precision 
Java :: java loop through array 
Java :: insert in arraylist 
Java :: hash map java 
Java :: java check prime number 
Java :: encapsulation java 
Java :: Java Method Create Basic 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =