Error: Could not find or load main class test.class HELP please -
public class test { public static void main(string args[]){ system.out.println("hello world"); } } i try run in cmd on windows 7 :
@echo off cls javac test.java cls java test.class pause and cmd returns: error: not find or load main class test.class
thanks reading
when compile file, means know class name should same it's file name. did not use package in code file, first of should change command prompt path folder code file in it.
for example file in c:\javalab folder. first should change path: c:> cd javalab , then: c:\javalab> java test.class
if use package, test.java file should in path demonstrate in front of package keyword.
for example package is: package com.org.prog; file should in com\org\prog folder. change command prompt path before org folder , enter java command: java com.org.prog.test
be careful command prompt path should of org folder before enter java command run test.class.
be successful.
Comments
Post a Comment