exception in thread 'main' java.lang.NoClassDefFoundError:

后端 未结 23 3577
心在旅途
心在旅途 2020-11-28 06:27

The following program is throwing error:

public class HelloWorld {
    public static void main(String args[]) {
        System.out.println(\"Hello World!\");         


        
23条回答
  •  甜味超标
    2020-11-28 06:46

    Here is what finally worked.

    `@echo off
    set path=%path%;C:\Program Files\Java\jdk1.7.0_71\bin;
    set classpath=C:\Program Files\Java\jdk1.7.0_71\lib;
    cd 
    javac .\trainingPackage\HelloWorld.java
    cd ..
    java trainingPackage.HelloWorld 
    REM (Make sure you are on the parent directory of the PackageName and not inside the    Packagedirectory when executing java).`
    

提交回复
热议问题