Topic: 请大家教一个问题 (NoClassDeffoundError: Employee)

  Print this page

1.请大家教一个问题 (NoClassDeffoundError: Employee) Copy to clipboard
Posted by: zxhhero
Posted on: 2004-09-29 13:56

{ 请尽量用准确的文字描述作为标题
提问前请搜寻一下旧帖子 -- e.g. with the keyword NoClassDefFoundError}


  大家好,我刚学Java,但一开始就搞一来了,在此肯求大家指点!
下面是几行代码,Javac能够通过,没有报错,生成了.class文件,但是在解释执行时不行,提示如下:“Excetipn in thread "main" java.lang.No ClassDeffoundError: Employee"
请教该问题怎么处理?

import java.io.*;
class Employee
{

private double salary;


Employee (double s)
{
salary = s;
}


double getSalary ()
{
return salary;
}


public static void main (String [] args)
{

Employee e = new Employee (30000.0);

2.Re:请大家教一个问题 [Re: zxhhero] Copy to clipboard
Posted by: eric_dasini
Posted on: 2004-09-29 15:29

你是在dos下执行的吗? 用java Employee.
你的程序没有错误,可能是jdk吧
用集成环境试试!

3.Re:请大家教一个问题 [Re: zxhhero] Copy to clipboard
Posted by: ljy0000
Posted on: 2004-09-29 15:31

import java.io.*;
public class Employee
{

private double salary;

Employee (double s)
{
salary = s;
}

double getSalary ()
{
return salary;
}

public static void main (String [] args)
{

Employee e = new Employee (30000.0d);

4.Re:请大家教一个问题 (NoClassDeffoundError: Employee) [Re: zxhhero] Copy to clipboard
Posted by: zxhhero
Posted on: 2004-09-29 19:25

谢谢楼上两位,小虾在这里有向你们致敬!!!
我的问题已解决,是环环境变量设置没有置全。
Thank you all the same!!


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923