虽然说不写了,但是想了想把以前的东西整理下的吧,嘿嘿,因为今天心情不错就多写一篇吧
不知道大家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.