`
fehly
  • 浏览: 248662 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Could not find the main class. Program will exit

    博客分类:
  • java
阅读更多

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

           不知道大家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.

分享到:
评论
发表评论

文章已被作者锁定,不允许评论。

相关推荐

    解决 Can not find the main class. Program will exit. 难题

    在IT领域,尤其是在Java编程中,遇到“Can not find the main class. Program will exit.”这一错误信息是非常常见的问题。这通常意味着编译器或运行环境无法识别并定位到程序的主类,即包含main方法的类,从而导致...

    could not find the main class,program will exit

    ### "Could Not Find the Main Class, Program Will Exit" 错误解析及解决方法 在Java编程过程中,我们经常会在开发环境中遇到各种各样的错误提示,其中“Could not find the main class, program will exit”是一...

    jar文件Could not find the main class解决办法

    NULL 博文链接:https://yintech.iteye.com/blog/374842

    java打jar包的方法

    ### Java打包成JAR文件的方法及解决“Could not find the main class, Program will exit”错误 在Java开发中,将程序打包成一个可执行的JAR文件是非常常见且实用的操作。这种方式不仅便于程序的分发与部署,还能...

    java反编译工具jd-gui-1.4.0.jar

    java反编译工具jd-gui-1.4.0.jar 可以查看jar包中的.class文件的java代码

    Auto_Runner使用教程

    2. **Java Virtual Machine Launcher问题**:若出现"could not find the main class.program will exit."的错误,可能是因为JDK版本过低。Auto_Runner需要1.5及以上版本的JDK。请确保已安装对应版本的JDK。 3. **...

    FlexGraphics_V_1.79_D4-XE10.2_Downloadly.ir

    - FIX: The TFlexPanel.FPaintCache field moved in the protected class section. Added rcPaint field in FPaintCache that represents drawing rectangle. - ADD: In the text prcise mode (TFlexText.Precise=...

    Java邮件开发Fundamentals of the JavaMail API

    The API's main purpose is not for transporting, delivering, and forwarding messages; this is the purview of applications such as sendmail and other Mail Transfer Agent (MTA) type programs. MUA-type...

    eclipse 下打包

    - **Could not find the main class, Program will exit.** - 当遇到这类问题时,通常是因为JAR文件缺少必要的类或库。如果项目中使用了特殊库(如SWT等),则需要进行额外的配置。 4. **处理SWT等特定库的情况**...

    微软内部资料-SQL性能优化2

    The main advantage of running in-process is that the system usually does not need to perform a context switch. The disadvantage to running in-process is that DLL has access to the process address ...

    微软内部资料-SQL性能优化3

    If the class is not confident in their understanding, review appendix A04_Locking and its accompanying PowerPoint® file. Transactions in SQL Server provide the ACID properties: Atomicity A ...

    Bochs - The cross platform IA-32 (x86) emulator

    class, optional commit support on Bochs exit, save/restore file attributes, 1.44 MB floppy support, set file modification date/time - converted the complete hdimage stuff to the new 'hdimage' ...

    gertt点阵图读取器(opengl)

    MessageBox(NULL,"Could Not Unregister Class.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION); hInstance=NULL; // Set hInstance To NULL } } /* This Code Creates Our OpenGL Window. ...

    opengl画图程序附带源代码

    MessageBox(NULL,"Could Not Unregister Class.","SHUTDOWN ERROR",MB_OK | MB_ICONINFORMATION); hInstance=NULL; // Set hInstance To NULL } } /* This Code Creates Our OpenGL Window. Parameters Are: * * ...

Global site tag (gtag.js) - Google Analytics