Could not find the main class. Program will exit

           虽然说不写了,但是想了想把以前的东西整理下的吧,嘿嘿,因为今天心情不错就多写一篇吧

           不知道大家Eclipse报过这个错误没,反正上次这个问题弄的我郁闷坏了

     

           当时也不是太清楚为啥会报这个,查了好多资料最后明白了,因为我的linux是jdl1.6版本,xp下是1.5的 

Could not find the main class. Program will exit.”
I just installed the latest available Eclipse version (3.2 milestone 5) and couldn’t run my ANT builds anymore. The error I got in the alert box was “Could not find the main class. Program will exit”.

The problem was that the ANT_HOME variable was still pointing to the previous Eclipse folder and the solution was simply to change the path. This can be done through Window->Preferences->Ant->Runtime. Once there, click the “Ant home…” button in the “Classpath” tab and browse to the ANT plugin folder in your Eclipse installation. Now hit the OK button and try to run the build file again. Everything should work again.

Oh and by the way, I had a really good laugh with the “Run Garbage Collector” button !

 

分析:可能是在打开方式中的javaw版本过低。比如jdk1.5编译的class文件用1.4的javaw打开就会出现这个问题。当然1.5打开1.6的也会出现,只少我是出现了。

解决方案:控制面板->文件夹选项->文件类型->JAR下面的<高级>按纽
<操作>下面选open , 点右边的<编辑>,修改javaw路径,如:"C:\Program Files\Java\jdk1.5.0_10\bin\javaw.exe" -jar "%1" "%*"

 

 

sun公司的观点

CAUSE

WJView.exe or Javaw.exe cannot find the program it is trying to run.


SOLUTION

If this error occurs during startup, it is mostly likely caused by a spyware or adware program which is missing, corrupt, or partially deleted.


Remove Spyware/Adware

Using your favorite search engine, search for "spyware removal utility" as your search phrase. This search will help you locate many free spyware removal utilities.

Note: The Spyware Removal Utility can help you get rid of this error message partially. Any new spyware can get itself downloaded to your system later. To get rid of this problem completely, try the second option given below.


Remove WJView entries from Startup

Wjview lets you view Windows based Java applications. You might receive an error message if Wjview attempts to start an application on your system that no longer exists.

You may need to modify the system configuration settings to completely get rid of the error. To do so, follow these steps:
Click Start > Run.
The Run dialog box appears.
Type msconfig.exe.
Click OK.
The System Configuration Utility dialog box appears.
Select the Startup tab.
Deselect the WJView.exe and/or javaw.exe check boxes that are associated with this problem.
Click OK.
You will be prompted to restart the computer. Restart the system to apply changes.

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值