A question regarding Java project in ECLIPSE IDE

A question regarding eclipse.

No offence meant.

I have added a jar file to the current project in its build path.

This executes the concerned class file which is in the jar file.

If I remove the jar file from the build path and run the project,

it still executes that class file.

I tried building a clean project and running it,but still executes the jar file and the class.

Any idea why this is happening?

[455 byte] By [bhuru_luthriaa] at [2007-10-3 2:51:20]
# 1

> A question regarding eclipse.

> No offence meant.

People are not usually offended by Eclipse.

> I have added a jar file to the current project in its

> build path.

> This executes the concerned class file which is in

> the jar file.

>

> If I remove the jar file from the build path and run

> the project,

> it still executes that class file.

>

> I tried building a clean project and running it,but

> still executes the jar file and the class.

>

> Any idea why this is happening?

You have that class file elsewhere

or you have confused your problem statement.

Why don't you create a new project and add everything except that class/jar (whichever yu mean)

aniseeda at 2007-7-14 20:40:12 > top of Java-index,Java Essentials,Java Programming...
# 2
Where is that JAR located?
CeciNEstPasUnProgrammeura at 2007-7-14 20:40:12 > top of Java-index,Java Essentials,Java Programming...
# 3

> Any idea why this is happening?

If that .jar file is stored in your JAVA_HOME/lib or JAVA_HOME/lib/ext

directory you don't need to put it on your build path because your JVM

will check those locations anyway. Whether or not that location is a

good one for that .jar file is another question.

Go to your project properties, select 'build path' and check out if eclipse

considers that .jar of yours to be part of the JRE (there's a little plus

sign you can click next to the JRE entry).

kind regards,

Jos

JosAHa at 2007-7-14 20:40:12 > top of Java-index,Java Essentials,Java Programming...
# 4

I have 2 projects in eclipse:

MyTests

Rel800 (which contains all the original jars and code)

I have created my classes in the MyTests,compile them.

MyTests have a dependency on Rel800

Then I go to the DOS prompt and create a jar file.

I copy the jar file to the jar folder of Rel800.

Then thru eclipse, I go to Rel800->properties->buildpath->libraries>add external libraires.

If I remove the jar file from REL800,it still executes that class.

bhuru_luthriaa at 2007-7-14 20:40:12 > top of Java-index,Java Essentials,Java Programming...
# 5
> MyTests have a dependency on Rel800That's the one: you told eclipse that MyTests need another project namedRel800. You should remove that dependency also.kind regards,Jos
JosAHa at 2007-7-14 20:40:12 > top of Java-index,Java Essentials,Java Programming...
# 6

But if I remove the dependency,then how will it run the application.

MyTests has a dependency on Rel800

Then I create a new Run window (ie via Debug)

Project : MyTests

Main class: com.apps.Startup.

Becos of the dependency,it can execute com.apps.Startup which is in the REL800 project.

Remember,MyTests will contain 2 or 3 classes at most.

bhuru_luthriaa at 2007-7-14 20:40:12 > top of Java-index,Java Essentials,Java Programming...
# 7

> But if I remove the dependency,then how will it run

> the application.

Someone should take your computer away.

1) You can use Eclipse to create JARs

2) If you don't want your stuff to get the classes, don't add the classes

3) If you do want your stuff to get the classes, add them, one way or the other. Make up your mind.

CeciNEstPasUnProgrammeura at 2007-7-14 20:40:12 > top of Java-index,Java Essentials,Java Programming...