“未解决的编译问题";在Eclipse Indigo中运行MPJ Express的方法 [英] "Unresolved compilation problems" from running MPJ express in Eclipse Indigo
问题描述
我遵循了Utube的教程,内容涉及如何在IDE中使用MPJ Express运行并行应用.我下载了最新版本的MPJ Express,并使用了Eclipse Indigo.
I followed a tutorial from Utube on how to run parallel aplications using MPJ Express in an IDE. I downloaded the latest version of MPJ Express and used Eclipse Indigo.
我确实将MPI包含在我的项目JAR文件中.当我尝试编译一个简单的"hello程序"时,出现此错误:
I did include in my project JAR file for MPI. When I tried to compile a simple "hello program," I got this error:
由以下原因引起:java.lang.Error:未解决的编译问题:无法解析mpi.MPIException类型.从所需的.class文件间接引用
Caused by: java.lang.Error: Unresolved compilation problems: The type mpi.MPIException cannot be resolved. It is indirectly referenced from required .class files
我的代码是
import mpi.*;
public class HelloEclipsWorld {
public static void main(String[] args) throws Exception {
MPI.Init(args);
int rank = MPI.COMM_WORLD.Rank();
int size = MPI.COMM_WORLD.Size();
System.out.println("I am process < " + rank + " > of total < " +
size + " > processes.");
MPI.Finalize();
}
}
我在做什么错了?
推荐答案
这看起来像是类路径错误.根据您的编辑,看起来您正在使用Eclipse.右键单击项目时,选择Build Path > Configure Build Path...
,然后转到库"(或定单和导出")选项卡,您应该看到mpj.jar
.我猜它不会在那里了,您需要添加它.
This looks like a classpath error. Based on your edit, it looks like you're using Eclipse. When you right-click on your project, select Build Path > Configure Build Path...
and then go to the "Libraries" (or "Order and Export") tab, you should see mpj.jar
. I'm guessing it won't be there, and you'll need to add it.
这与您所说的mpi.jar
不同.我只是使用您提供的代码和mpj.jar
(从此处下载)建立了一个简单的测试项目. ),一切正常.
This is not the same as mpi.jar
, which you said you have. I just set up a simple test project using the code you provided and mpj.jar
(downloaded from here), and everything works.
这篇关于“未解决的编译问题";在Eclipse Indigo中运行MPJ Express的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!