I have three .class files that I'm supposed to black-box test. They are under a package named one.two.three
. I'm having difficulty accessing them. I started a new java project in eclipse and created a package with the same name. I then proceeded to add the three .class files to bin/one/two/three
. If I try using the classes Eclipse can't find them and I get compiler errors. I'm using the appropriate package header. Any help is greatly appreciated, thanks.
Asked
Active
Viewed 5,266 times
1

Bimalesh Jha
- 1,464
- 9
- 17

Steve
- 4,446
- 7
- 35
- 50
-
are they .class files or .java files? – Ray Tayek Mar 05 '13 at 00:59
-
hi ray, they're .class files i don't have access to the .java ones – Steve Mar 05 '13 at 01:00
-
you will need to get them into a jar and/or onto the build path somehow. – Ray Tayek Mar 05 '13 at 01:02
-
I tried adding them as external class files but doing so doesn't give me access to the enum inside the class. I was told they have to be in the same package in order to work. Thanks – Steve Mar 05 '13 at 01:04
-
2you should get access if you put then in the right place. put them in foo/one/two/three/ and then add foo/ as a class folder. – Ray Tayek Mar 05 '13 at 01:10
1 Answers
0
assuming bin/
is your output folder in the Eclipse project settings. Simply dropping the class files under bin/one/two/three
will not work as eclipse will either delete them (on clean build) or just ignore these extra artifacts. Do as @Ray Tayek says- keep them in a different directory and edit project classpath and add this as class folder. This should work.

Bimalesh Jha
- 1,464
- 9
- 17