Core Java Study - 2

Eclipse Installation

 

1. Download jdk from sun.com

2. Install jdk

    For I am using Vista, jdk is installed in C:/Programme File/Java/jdk

3. Set Path

    Set system enviroment variable add " C:/Programme File/Java/jdk/bin" to Path

4. Try in command javac, if the usage is showed, it has gone OK.

 

But when I runned the hellowworld in command, it is OK.

 

But in Eclipse, it seems to be wrong with error in the Console window:

 

java.lang.NoClassDefFoundError: v1ch02/Welcome/Welcome
Caused by: java.lang.ClassNotFoundException: v1ch02.Welcome.Welcome
 at java.net.URLClassLoader$1.run(Unknown Source)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(Unknown Source)
 at java.lang.ClassLoader.loadClass(Unknown Source)

 

Till now I cannot figure out what is wrong.

 

Finally, I have found the problem.

 

Eclipse has a default JRE named jre6  under java project, maybe the jdk you install is not the same version as the default, when you run your programme such error will occur.

 

The Solution is:

1. Change the JRE Directory

Window->Preferences->Java->Installed JREs->Add->JRE name:jdk-[version];JRE home directory:C:/Java/jdk

2. Add your file to src default package

Right Click your project->Build Path->Configure Build Path->Add Folder

3. Add Alternative JRE

Right Click your project->Build Path->Add Library->JRE System Library->Alternative JRE:your jdk

 

In the process of solving this problem, I have found a page explained well about the configuration of java dev-platform

http://www.cnblogs.com/pricks/archive/2009/05/28/1491392.html

 

But I cannot figure the tomcat, to reach http://localhost:8080

 

->In the End, I found the problem is that the Mcafee block that, but I have no access to change the config of Mcafee.

I decide to abandon this try. But all was right with the other computer which I have the totally admin priviledge.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值