Chris Grindstaff wrote:
> Thursday, July 31, 2003, 3:00:37 PM, you wrote:
>
> ROH> Chris Grindstaff wrote:
>
>>>Friday, July 25, 2003, 10:53:47 AM, you wrote:
>>>
>>>ROH> Hi,
>>>
>>>ROH> In Eclipse, using version 2.1.0, I'm trying to use some utility
>>>ROH> classes which I have in a folder outside of my Eclipse directory.
>>>ROH> These classes are not in a jar, they are just .class files. Is there
>>>ROH> a way that I can get Eclipse to find and use those classes, perhaps
>>>ROH> reminiscent of the classpath environment variable I am used to setting
>>>ROH> for the JDK?
>>>
>>>ROH> I keep finding ways that Eclipse offers to copy ("import") the files
>>>ROH> into the Eclipse project folder. But I want to keep just one copy of
>>>ROH> these utility classes.
>>>
>>>Rich,
>>> If it does exist it's Properties of a Java Project > Java Build
>>> Path > Libraries > Add Class Folder. Then choose Create New
>>> Folder, click Advanced and Link to folder in the file system.
>>
>
> ROH> Thank you Chris. I've been trying everything I can think of, but
> ROH> still can't make it work. Part of my difficulty may concern the
> ROH> interplay of package names and folder names.
>
> ROH> I get this far
> (properties >> Java Build Path > Libraries > Add Class Folder >
> Create New Folder >> Advanced > Link to folder in the file system >
> ROH> Browse ...
>
> ROH> In the Browse For Folder dialog I select my folder of utility classes,
> ROH> then, back in the New Folder dialog, I reach a confusing point. I
> ROH> get an error message "Folder name must be specified" even though the
> ROH> folder I just selected is listed in a text area. The OK button is
> ROH> disabled.
>
> ROH> I can proceed by writing a folder name into the Folder name text area,
> ROH> but I'm not sure what it expects there. What does it mean by forcing
> ROH> me to specify two folders? I've tried a half dozen things at this
> ROH> point, and I have more ideas for ways to experiment, but still have
> ROH> not found a way that works.
>
> Rich,
> I agree that it's confusing. The name that you specify in the
> text area is just that, a name. It's a "handle" or a way to refer
> to the linked folder.
>
> Here's a specific example that worked fine for me. I specified a
> name of "bob" and selected the c:\temp\classes directory. Click
> OK all the way out. Then I went to Windows explorer and unzipped
> a jar into the c:\temp\classes directory. Go back to Eclipse,
> right mouse click and refresh on my project's "bob" folder and
> sure enough all of the classes now appear.
>
> Perhaps you can be more specific?
>
> Chris




For instance:
In Navigator, I create a new project "tryUtility", in it I create a
new package "main".  Into this package I copy a class HelloInt.

package main;
public class HelloInt {

   public static void main(String[] args) {
     System.out.println(IntegerFormatter.format(334928,14));
   }
}


My Eclipse directory is C:\B\E\ Elsewhere I have a directory C:\temp\utility which contains IntegerFormatter.java, a utility which I want to use.

In Navigator, I right click on project tryUtility.  Then
Properties > Libraries > Add Class Folder > Create New Folder >
Advanced > Link to folder in file system > Browse ...

I select C:\temp\utility, and back in the New Folder dialog type "bob"
in the Folder name text field.  I click OK, then OK again.

Then, back in the "Properties for tryUtility" dialog, the OK button is
disabled. An error message near the top of that dialog says
"Cannot nest 'tryUtility/bob' inside 'tryUtility'. To enable the
nesting exclude 'bob/' from 'tryUtility'." For your enjoyment I'll try to attach a gif of that dialog window. I am having fun, and hope you can have fun too.


Rich

<<inline: Image51.gif>>

Reply via email to