由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Simple Question About Eclipse
相关主题
Eclipse 编译求助求Spring MVC 简单的例子
请问如何在jbuider里面安装poi?为何运行JAVA出现这个错误?
org..eclipse.swt errortogether for eclipse 里能否指定一个目录保存那些图
UnsatisfiedLinkErrorHelp with Tomcat for Eclipse v1.03
mac不需要下载安装JDK,那还需要建立新的executable path么?eclipse下生成的jar file不包含library
How can I organize Projects in Eclipsehelp pls. on installation of svn via eclipse
[合集] How to remove absolute path in eclipse project filemacosx下,找不到javaws.jar和jnlp.jar
有人用eclipse吗?Eclipse export,有javaws的时候如何设置
相关话题的讨论汇总
话题: project话题: eclipse话题: path话题: go话题: java
进入Java版参与讨论
1 (共1页)
s*i
发帖数: 31
1
In eclipse, i have project 1, where i define 2 classes and make them both
belong to a package i define (eg: com.myPackage).
Then i create project 2, and i want to use those 2 classes from project 1.
It seems that i can accomplish this two ways:
1) Go to Java Build Path->Projects, add Project 1 as a "Required project"
for Project 2. And write "import com.myPackage.*" statement at the top of
Project 2's source code.
2) Go to Java Build Path->Libraries, click "Add Class Folder", and choose
the fo
k***r
发帖数: 4260
2
i'd imagine method 1 would make project 1 a dependency of project 2
and will force compilation of project 1 when project 2 is compiled,
instead of just the a few classes in method 2.

【在 s*i 的大作中提到】
: In eclipse, i have project 1, where i define 2 classes and make them both
: belong to a package i define (eg: com.myPackage).
: Then i create project 2, and i want to use those 2 classes from project 1.
: It seems that i can accomplish this two ways:
: 1) Go to Java Build Path->Projects, add Project 1 as a "Required project"
: for Project 2. And write "import com.myPackage.*" statement at the top of
: Project 2's source code.
: 2) Go to Java Build Path->Libraries, click "Add Class Folder", and choose
: the fo

p******e
发帖数: 897
3
actually 1) is more standard than 2), use 1) you can make sure project 2
always get latest code from project 1 and you don't need to hard code
project 1 output directory in project 2 class path

【在 s*i 的大作中提到】
: In eclipse, i have project 1, where i define 2 classes and make them both
: belong to a package i define (eg: com.myPackage).
: Then i create project 2, and i want to use those 2 classes from project 1.
: It seems that i can accomplish this two ways:
: 1) Go to Java Build Path->Projects, add Project 1 as a "Required project"
: for Project 2. And write "import com.myPackage.*" statement at the top of
: Project 2's source code.
: 2) Go to Java Build Path->Libraries, click "Add Class Folder", and choose
: the fo

k***r
发帖数: 4260
4
hmmm. i have never had to modify output directory in eclipse ...
Am I missing anything?

【在 p******e 的大作中提到】
: actually 1) is more standard than 2), use 1) you can make sure project 2
: always get latest code from project 1 and you don't need to hard code
: project 1 output directory in project 2 class path

p******e
发帖数: 897
5
most time you don't need, default output directory is good enough, but you
can easily change this property.
And if you use option 2), each time you change the output directory, you
must remember change the project 2 class path too.

【在 k***r 的大作中提到】
: hmmm. i have never had to modify output directory in eclipse ...
: Am I missing anything?

1 (共1页)
进入Java版参与讨论
相关主题
Eclipse export,有javaws的时候如何设置mac不需要下载安装JDK,那还需要建立新的executable path么?
问个关于jar的问题.How can I organize Projects in Eclipse
Eclipse project doesn't build[合集] How to remove absolute path in eclipse project file
如何在eclipse 里set java running environment的path有人用eclipse吗?
Eclipse 编译求助求Spring MVC 简单的例子
请问如何在jbuider里面安装poi?为何运行JAVA出现这个错误?
org..eclipse.swt errortogether for eclipse 里能否指定一个目录保存那些图
UnsatisfiedLinkErrorHelp with Tomcat for Eclipse v1.03
相关话题的讨论汇总
话题: project话题: eclipse话题: path话题: go话题: java