打开一个现有的Java项目 [英] Opening an existing Java project

查看:135
本文介绍了打开一个现有的Java项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮助我使用Eclipse或Netbeans打开现有的Java项目吗?
这是SourceForge上的一个特定项目, SMPPClientServer



我想做的只是让这个项目运行。但是,这似乎是一个挑战,因为我完全是Java的新手(我是C#.Net开发人员)。

解决方案


  • 从sourceforge下载.jar,将其保存在PC上的某个位置。

  • 打开eclipse。

  • 您需要打开包资源管理器窗口 - 默认情况下应该打开我想在LHS上。

  • 右键单击New - > Project,然后选择Java Project

  • 点击下一步

  • 给你的项目一个名字,基本上可以是任何东西,虽然有命名标准。例如MyProject

  • 单击下一步,然后单击完成。

  • 现在,您将在包资源管理器窗口中创建一个名为MyProject的项目。 >
  • 现在,您需要将jar导入到项目中:

  • 在项目中创建一个文件夹,您可以在其中保留任何jar。右键单击MyProject,新建 - >文件夹,并给它一个名称,说x-jars

  • 此文件夹将在MyProject下创建。这是一个真正的(系统)文件夹,你想将你的jar复制到这个文件夹。该文件夹将位于您的文件系统上,位于〜eclipse-workspace / MyProject / x-jars /

  • 复制到x-jars文件夹后,在eclipse中选择MyProject并点击F5刷新。这个jar现在会显示在你的x-jars文件夹下(你可以通过点击小三角形来扩展一个文件夹的内容)

  • 现在你想要实际使用你的jar:

  • 右键单击MyProject下的src(src是保存所有Java类的地方)。 Do New - > Package,并按照标准约定给出一个名称,如:com.mydomain.smpp,然后单击Finish。

  • 右键单击生成的包,然后执行新建 - >类,给它一个名字,例如MyTest,然后单击完成。

  • 您将在主eclipse编辑器中拥有一个Java类的框架。这个类生活在包com.mydomain.smpp中。所有类都应该包在一个包中。

  • 最后,您需要确保x-jars文件夹包含在构建(编译)路径中。右键单击MyProject,执行构建路径 - >配置构建路径。在库选项卡上,单击添加JARS,然后在MyProject中选择x-jars文件夹。

  • 就是这样。我不能帮你设置一个试用的SMPP应用程序/类,因为似乎没有任何文档或已发布的API,但这是您需要做的使用该jar。


Can someone help me to open an existing Java project using Eclipse or Netbeans? It's a specific project on SourceForge, SMPPClientServer.

All I want to do is to just get this project to run. But, this seems like a challenge at the moment as I'm totally new to Java (I'm a C#.Net developer).

解决方案

  • Download the .jar from sourceforge, save it somewhere on your PC.
  • Open eclipse.
  • You need the "Package Explorer" window open - should be open by default I think, on the LHS.
  • Right click, New -> Project, and select "Java Project"
  • Click Next
  • Give your project a name, can be basically anything, although there are naming standards. E.g MyProject
  • Click Next, then click Finish.
  • You'll now have a new project called MyProject in the Package Explorer window.
  • Now you need to import the jar to your project:
  • Create a folder in your project in which you'll keep any jars. Right click on "MyProject", New -> Folder and give it a name, say "x-jars"
  • This folder will be created below MyProject. This is a real (system) folder, and you want to copy your jar into this folder. This folder will be located on your filesystem at ~eclipse-workspace/MyProject/x-jars/
  • When copied into the x-jars folder, back in eclipse select MyProject and hit F5 to refresh. The jar will now show up under your x-jars folder (You can expand a folder contents by clicking the little triangles)
  • Now you want to actually use your jar:
  • Right click on "src" under MyProject (src is where you keep all your java classes). Do New -> Package, and per standard conventions give it a name like: com.mydomain.smpp and click Finish.
  • Right Click on the resulting Package and do New -> Class, and give it a name, e.g MyTest, and click Finish.
  • You'll now have the skeleton of a Java class in your main eclipse editor. This class lives in the Package com.mydomain.smpp. All classes should live in a package.
  • Finally you need to make sure that the x-jars folder is included in your build (compile) path. Right click on MyProject, do Build Path -> Configure Build Path. On the Libraries tab click "Add JARS", and select the x-jars folder in MyProject.
  • And that's it. I can't help you set up a trial SMPP app/class as there does not appear to be any docs or published API, but this is what you need to do to use the jar.

这篇关于打开一个现有的Java项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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