如何在给定整个源文件的情况下打开现有 Java 项目

发布于 2024-12-29 01:46:53 字数 1413 浏览 0 评论 0原文

我在打开我必须处理的现有黑莓 Eclipse 项目时遇到一些问题。该项目已保留在一个文件夹中,其中包含 bin、deliverables、src 和 res 等子文件夹。我该如何打开这个?我尝试过“将现有项目导入工作区”并选择该文件夹 - 它将项目加载到 Eclipse 的左侧横幅上,但图标上有一个红色解释标记。当我右键单击该项目并选择“作为黑莓模拟器运行”时,没有任何反应。我查阅了这些文章:

打开现有的Java项目
在 eclipse 中打开现有的 java 项目

但我似乎已经获得了整个项目结构而不仅仅是 .jar 文件,所以我不确定这些是否是要遵循的步骤。我已经尝试过以下

  1. 文件 ->导入->将现有项目放入工作区
  2. 浏览该目录。

它加载项目,但在项目上显示红色感叹号。我在左侧横幅上加载的另一个项目在项目图标上没有感叹号,也可以右键单击并作为黑莓模拟器运行。我正在使用黑莓 Eclipse 插件。

感谢您的帮助!


在问题视图下进行编辑

:“在解决构建路径错误之前无法构建项目”和“未绑定的类路径容器:项目‘MyProject’中的‘JRE System Library [BlackBerry JRE 6.0.0]”

原始工作已由 ADMIN 用户完成谁将项目复制到服务器。 原始文件,但它仍然来自

C:\Users\ADMIN\Documents\Workspace\PROJECTNAME\deliverables\Standard\6.0.0 

尽管我从服务器位置复制了 。我复制它的位置是在我的本地计算机上,

C:\Users\MYNAME\Documents\workspace\PROJECTNAME\deliverables\Standard\6.0.0

该路径是我找到的一个 jar 文件。 ..\Standard\7.0.0 中也有一个。用户在下面提供了右键单击“解决”的反馈,但我对如何右键单击“解决”并提供正确的路径感到困惑。我不确定这是否是正确的 .jar 文件,说实话,我不太确定黑莓目录在这种情况下如何工作。我正在关注这篇文章

http://agile.csc.ncsu.edu/SEMaterials/教程/import_export/

I'm having some trouble opening an existing blackberry eclipse project I have to work on. The project has been left for me in a folder which includes subfolders such as bin, deliverables, src and res. How do I go about opening this? I've tried "import existing projects into workspace" and selecting that folder - which loads the project on the left hand banner of eclipse but with a red explanation mark on the icon. When I right click the project and select "run as blackberry simulator" nothing happens. I have consulted these articles:

Opening an existing Java project
open existing java project in eclipse

but I seem to have been given the entire project structure instead of just the .jar file so I'm not sure if these are the steps to follow. I have tried the followed

  1. File -> Import -> Existing Project into Workspace
  2. Browse for that directory.

which loads the project but gives the red exclamation mark on the project.My other project which is loaded on the left banner does not have the exclamation mark on the project icon and can also be right clicked and run as a blackberry simulator. I am using the blackberry eclipse plugin.

Thanks for any help!


EDIT

Under Problems view: "The project cannot be built until build path errors are resolved" and "unbound classpath container: 'JRE System Library [BlackBerry JRE 6.0.0] in project 'MyProject'"

Original work had been done by an ADMIN user who had copied the project to the server. The original file would have come from

C:\Users\ADMIN\Documents\Workspace\PROJECTNAME\deliverables\Standard\6.0.0 

although I copied it from the server location. The place where I copied it is on my local machine at

C:\Users\MYNAME\Documents\workspace\PROJECTNAME\deliverables\Standard\6.0.0

That path is a jar file I found. There is also one in ..\Standard\7.0.0. A user provided feedback below to right click on resolve but I am confused as how I can right click on resolve and provide the correct path . I am not sure if this is is the correct .jar file to be honest I am not too sure on how blackberry directories work in this case. I am following this article

http://agile.csc.ncsu.edu/SEMaterials/tutorials/import_export/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

一瞬间的火花 2025-01-05 01:46:53

请遵循以下有关将 Blackberry 插件安装到 Eclipse 中的综合指南:

http://www.blackberryforums.com/developer-forum/138210-setup-up-eclipse-blackberry-development.html

Follow this comprehensive guide on installing Blackberry plugin into eclipse:

http://www.blackberryforums.com/developer-forum/138210-setup-up-eclipse-blackberry-development.html

痴情 2025-01-05 01:46:53

无需重新安装,事实证明我使用的是 JRE 7.0.0,需要 6.0.0。我从 BB Java 插件更新站点安装了 JRE,在 Eclipse 重新启动后我能够打开该项目。如果其他人有类似问题,则可使用 Eclipse 的链接为:http://www.blackberry.com/go/eclipseUpdate/3.6/java" rel="nofollow">http://www.blackberry.com/go/eclipseUpdate/3.6/java" blackberry.com/go/eclipseUpdate/3.6/java

No reinstall was necessary and it turns out that I was using the JRE 7.0.0 and needed 6.0.0. I installed the JRE from the BB Java plug-in update site and after an Eclipse restart I was able to open the project. The link to use with Eclipse if anyone else has a similar issue is: http://www.blackberry.com/go/eclipseUpdate/3.6/java

执笔绘流年 2025-01-05 01:46:53

Eclipse 中的红色感叹号通常表示类路径问题(即某些库丢失或配置不正确)。使用“标记”视图获取有关错误的更多详细信息。

The Red exclamation mark in Eclipse usually signals class-path problems (i.e. some libs are missing or they are not configured correctly ). Use the Markers view to get more details about the errors.

悲欢浪云 2025-01-05 01:46:53

您似乎有构建路径问题。这是正常的,因为其他开发人员可能在他的计算机上使用绝对路径引用了库,而这些库不一定存在于您的计算机上的同一位置。

打开问题视图并查看可以解决的问题。

You seem to have build path issues. It is normal since the other developer might have referred to libraries using absolute paths on his machine which need not necessarily exist in the same location on yours.

Open the Problems view and see what you can resolve.

小鸟爱天空丶 2025-01-05 01:46:53

好吧好吧,问题是因为 eclipse 中 jar 文件的路径不正确。

例如您之前在机器 A 上的 Eclipse 中工作过。您的库文件位于 D:/MyJarFiles/ 处。现在,您将该文件夹复制到 Pen Drive 中,并复制到机器 B 和 B 中。在 Eclipse 中导出。现在只需将鼠标悬停在您的库/jar 文件上即可。您将看到机器 A 中定义的路径(即 D:/MyJarFiles/)。在机器 B 中,您可能在其他路径中有 jar 文件(例如 D:/JarFiles/)。由于 Eclipse 在机器 B 中找不到路径 D:/MyJarFiles/,因此会抛出错误。由于不包含 jar 文件,您的 Java 文件中将会出现错误(因为您的 import 无法正常工作)。

如何解决

只需创建 D:/ MyJarFiles/ 并将 jar 文件放在那里
或者
右键单击 jar 文件,然后单击“解析”并提供正确的路径。我相信您已经完成了一个,所有 jar 文件都会检测新位置。

祝你好运!!!

Well Well Well, the problem is because the path for the jar files are INCORRECT in eclipse.

E.g You earlier did work in Eclipse at machine A. There you had your library files at D:/MyJarFiles/. Now you copied that folder in Pen Drive and copied in you machine B & exported in eclipse. Now just take mouse over your library/jar files. You will see the path that was defined in the machine A (i.e. D:/MyJarFiles/). In machine B, you might have jar files at some other path (like say D:/JarFiles/). As Eclipse can't find path D:/MyJarFiles/ in machine B, it throws error. As jar files are not included, you will get error in your Java file (as your import is not working)..

How to solve

Just create D:/MyJarFiles/ and put jar files there
OR
Right Click on jar file and click resolve and provide correct path. I believe you are done with one, all jar files will detect new location.

Good Luck!!!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文