Eclipse未解决的编译 [英] Eclipse Unresolved compilation

查看:119
本文介绍了Eclipse未解决的编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Eclipse Indigo 3.7.2中处理更大的项目时,我确实遇到了这个非常奇怪的问题。
我使用Subclipse插件从SVN存储库中签出了项目,并且在启动应用程序时收到以下错误消息:

 线程主中的异常java.lang.Error:未解决的编译问题:anares.preprocess.StanfordParser.getInstance(StanfordParser.java:73)
中的

anares.start.Startconsole。< init>(Startconsole.java:22)
在anares.start.Startconsole.main(Startconsole.java:52)

这是Startconsole.class的样子,包含主要方法:

 包anares.start; 

import java.io.FileNotFoundException;
import java.io.IOException;

导入anares.core.AnaResAlgorithm;
import anares.preprocess.MorphaDornerSentenceSplitter;
import anares.preprocess.CollectionEquipper;
import anares.preprocess.ParserHandlerInterface;
import anares.preprocess.Preprocessor;
import anares.preprocess.SplitterInterface;
import anares.preprocess.StanfordParser;
import anares.text.AnaResTextObject;

公共类Startconsole {

public final ParserHandlerInterface parserint = StanfordParser.getInstance();

公众最终SplitterInterface splitterint = MorphaDornerSentenceSplitter.getInstance();

public final CollectionEquipper equipperint = null;

public final static int buffersize = 5;

私有Startconsole(字符串文件)抛出IOException {
AnaResTextObject object = startPreprocess(file);
startAlgorithm(object);
}

私有AnaResTextObject startPreprocess(String file)引发IOException {
Preprocessor prepro = new Preprocessor(parserint,splitterint,
equipperint);
AnaResTextObject textObject = prepro.preprocessText(文件);
return textObject;
}

private void startAlgorithm(AnaResTextObject object){
AnaResAlgorithm algo = new AnaResAlgorithm(buffersize);
algo.resolveAnaphora(object);
}

public static void main(String args [])抛出FileNotFoundException,
IOException {
if(args.length> 0){
Startconsole控制台=新的Startconsole(args [0]);
} else {
Startconsole控制台= new Startconsole( Text.txt);
}
}
}

我刚才说的是较大的项目,因此包含一些.jar文件和对其他软件包的引用。

仅在我的笔记本电脑上出现此问题。在我的另一台PC上,一切正常,并且我的同一个学生在同一项目上工作,也没有任何问题。
我已经尝试过再次检查项目,清理它,甚至重新安装eclipse。

现在,这是一个很奇怪的部分:如果我注释掉整个主要方法,只留下

  public static void main(String args [])抛出FileNotFoundException,
IOException {
// if(args。长度> 0){
// Startconsole控制台= new Startconsole(args [0]);
//} else {
// Startconsole控制台= new Startconsole( Text.txt);
//}
System.out.println( H​​ello World!);
}

我仍然收到与行号完全相同的错误消息。而且没有 Hello World!在输出中。

是否有人对问题出处有任何想法?

解决方案

您的问题似乎就像我看不到的代码错误,或者您的Eclipse实例/编译器进入了一个无法恢复的奇怪状态一样。检查


  1. 您是否尝试过重新启动Eclipse?

  2. 您是否在所有版本上都使用了相同版本的Java?电脑?例如。 Java 6和Java 7之间可能存在一些不兼容性。

  3. 是否打开了自动构建功能?在项目/自动生成菜单项中查找。自动Java构建器可能已关闭,因此它无法重新编译代码。

  4. 您是否尝试清理项目以强制重新构建? (项目/清洁菜单项。)

  5. 您的Eclipse实例中是否安装了JDT?应该的,但是可能值得检查这样的琐碎问题。

  6. 也许您应该尝试创建一个新的工作区,然后再次签出项目。

    • 您也可以尝试使用这个新的工作区思想再次下载Eclipse。


如果这两种方法都不起作用,我不知道要寻找什么。


I have this really weird problem working on a bigger project in Eclipse Indigo 3.7.2. I checked out the project from an SVN repository using the Subclipse plug-in and when I start the application I get the following error message:

Exception in thread "main" java.lang.Error: Unresolved compilation problem: 

at anares.preprocess.StanfordParser.getInstance(StanfordParser.java:73)
at anares.start.Startconsole.<init>(Startconsole.java:22)
at anares.start.Startconsole.main(Startconsole.java:52)

This is what Startconsole.class looks like, containing the main method:

package anares.start;

import java.io.FileNotFoundException;
import java.io.IOException;

import anares.core.AnaResAlgorithm;
import anares.preprocess.MorphaDornerSentenceSplitter;
import anares.preprocess.CollectionEquipper;
import anares.preprocess.ParserHandlerInterface;
import anares.preprocess.Preprocessor;
import anares.preprocess.SplitterInterface;
import anares.preprocess.StanfordParser;
import anares.text.AnaResTextObject;

public class Startconsole {

public final ParserHandlerInterface parserint = StanfordParser.getInstance();

public final SplitterInterface splitterint = MorphaDornerSentenceSplitter.getInstance();

public final CollectionEquipper equipperint = null;

public final static int buffersize = 5;

private Startconsole(String file) throws IOException {
    AnaResTextObject object = startPreprocess(file);
    startAlgorithm(object);
}

private AnaResTextObject startPreprocess(String file) throws IOException {
    Preprocessor prepro = new Preprocessor(parserint, splitterint,
            equipperint);
    AnaResTextObject textObject = prepro.preprocessText(file);
    return textObject;
}

private void startAlgorithm(AnaResTextObject object) {
    AnaResAlgorithm algo = new AnaResAlgorithm(buffersize);
    algo.resolveAnaphora(object);
}

public static void main(String args[]) throws FileNotFoundException,
        IOException {
    if(args.length > 0){
        Startconsole console = new Startconsole(args[0]);
    }else{
        Startconsole console = new Startconsole("Text.txt");
    }
    }
}

As I was saying this is a bigger project and therefore contains a few .jar-files and references to other packages.
This problem only occurs on my laptop. On my other PC everything works fine, and a fellow student of mine, who works on the same project, does not have any problems either. I already tried checking the project out again, cleaning it up and even reinstalling eclipse.
Now here's the weird part: If I comment out the whole main method, just leaving something like

public static void main(String args[]) throws FileNotFoundException,
        IOException {
//      if(args.length > 0){
//          Startconsole console = new Startconsole(args[0]);
//      }else{
//          Startconsole console = new Startconsole("Text.txt");
//      }
    System.out.println("Hello World!");
}

I still get the exact same error message with the exact same line numbers. And no "Hello World!" in the output.
Does anyone have any ideas where the problem comes from?

解决方案

Your issue seems like either there is an error in the code that I cannot see, or your Eclipse instance/compiler got into a strange state it cannot recover from.

Just some basic ideas to check

  1. Have you tried restarting Eclipse?
  2. Are you using the same version of Java on all computers? E.g. there might be some incompatibilities between Java 6 and Java 7.
  3. Is automatic build turned on? Look in the Project/Build automatically menu item. It is possible that the automatic Java builder got turned off, and thus it does not recompile your code.
  4. Have you tried to clean your project to force a rebuild? (Project/Clean menu item).
  5. Is JDT installed in your Eclipse instance? It should be, but it might worth check for such trivial issue.
  6. Maybe you should try to create a new workspace, and checkout the projects again.
    • You could also try to download Eclipse again with this new workspace idea.

If neither of these things work, I have no idea what to look for.

这篇关于Eclipse未解决的编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆