Question : java.lang.NoClassDefFoundError: TestZone/java

checked java -version and javac -version and found no issues. infact i just created Test class and found printing hello successfully.

but not able to execute - java TestZone

Any clues?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
import java.util.*; 
import java.util.TimeZone; // this have included after getting error but still no luck :(
public class TestZone { 
    public static void main(String[] args) {
        String[] ids = TimeZone.getAvailableIDs();
	if(args != null)
		System.out.println("notnull"); 

        for(int i = 0; i < ids.length; i++) {
            System.out.println("ID " + i + " " + ids[i]);
        }
    } 
}

Answer : java.lang.NoClassDefFoundError: TestZone/java

There will be two case when you get that error:
1) before compiling/generating class file, you are trying to run
or
2) you are giving wrong class name while running
Random Solutions  
 
programming4us programming4us