About Eclipse does not compile the class problem

Source: Internet
Author: User

The solution to this problem is summed up:

1, see if the project--> build automatically is selected? If not, clean up and restart eclipse after the hook.

2, check your lib there is no unused (superfluous) jar bag, see your. classpath file, there are no errors in the path.

3, this is the most important point, there are problems view to see if there is any error information about this item, generally will have such words:
The project cannot is built until build path errors are resolved

Then the following prompts unbound classpath, generally in. classpath to remove these path.


Article Source: Fei Nuo network (www.firnow.com): http://dev.firnow.com/course/4_webprogram/jsp/jsp_js/200827/99678.html

=================================

Today, I suddenly discovered that eclipse does not automatically compile files. Baidu immediately searched for a while, according to the online said also done, but still not useful.

There's no way to make a fool of yourself there. The following prompts are found in [Properties->java build Path] of the project's right-click menu:

Build path entry is missing:/infomirrorserver/js

It occurred to me that I had accidentally built the wrong folder yesterday and deleted him immediately. Is that the reason for this. I guess eclipse must be in that file.

This information is recorded in the. So all the files are displayed in the project, and an uncommitted file with an asterisk is seen:. classpath

Don't ask, it's probably him. Open a look, in the second line there is such a sentence: <classpathentry kind= "src" path= "js"/>

The source file is like this:

<classpathentry kind= "src" path= "src"/>
<classpathentry kind= "src" path= "js"/>
<classpathentry kind= "Con" path= "Org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind= "Con" path= "Com.genuitec.eclipse.j2eedt.core.J2EE14_CONTAINER"/>
<classpathentry kind= "Lib" path= "Webroot/web-inf/lib/oscore-2.2.5.jar"/>
<classpathentry kind= "Lib" path= "Webroot/web-inf/lib/infoframe2.jar"/>
<classpathentry kind= "Lib" path= "Webroot/web-inf/lib/ojdbc14.jar"/>

。。。

So immediately delete the second row and save it. Haha, solve the problem.

Personal guess Eclipse reads the file at compile time, executes the second row and discovers that the JS folder does not exist, so throwing an exception does not go down to cause

Failed to compile.

The above is a person encountered an impossible to compile the situation of the solution, take out to share with you.


Article Source: Fei Nuo network (www.firnow.com): http://dev.firnow.com/course/3_program/java/javajs/20081011/149966.html

============================

Summary of problems with Eclipse not compiling classes

1. Make sure that Project-> build automatically    has been selected.

2. If selected, it does not work, use this trick: Project-> clean. -> Choose the 2nd clean pjoject selected below, select the item and click "OK"

3. Delete the current item, set up the compile file output path in advance, re-import the source file, and set eclipse to compile on save. The

4 is then automatically compiled when you save it. If the project leads to a unused jar bag, and the package was deleted by you, there will be no error but how can not compile the class file situation, you can remove all the packages, and then one after another introduction (required), Do not introduce all the bags at once, and the useless may cause undesirable consequences.

5. You want to delete a class file to regenerate, remove the class file, but the folder under the Classes directory is opened by other programs, such as Total commander. At this point, the compilation will not pass, under problems may prompt "con" t delete classes ... ". Turn off other programs and recompile.

6. There is a situation where the JRE System Library is removed and can be compiled by re-import. But what causes it is not clear.

7. Remove all the packages from the build path. Then add Jars,add libraries the need to add in, incredibly began to compile ...

8.Project-> Properties-> Java build Path-> source-> webroot/web-inf/classes
Then click the Build project again to automatically compile.

9. Then the most important to see whether the project below is missing the work directory, because CVS control does not add work as a version, so checkout after this directory, to hand-add some works can automatically compile the

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.