Import class that is not inside an eclipse project

Asked

Viewed 2,173 times

1

I wonder if there is a way to import and instantiate an object of a class that is, for example, inside a folder in my files and not in a project inside the eclipse.

2 answers

2

I’m sure they were.

There are at least 3 options:

The simplest is:

Select project > Properties > Java Build Path > Libraries tab > Click Add External Class Folder > Select folder.

  • Exactly that, but what I needed was a way to do this import without using Wizard, by clicking and selecting. Automatically do it by code

  • You can edit the . classpath after creating the project. It does not use Wizard, but it is not elegant.

1

In order to instantiate an object of this class, it needs:

  1. be a class in your project or
  2. Be on your project’s dependency list
  • In addition to the form I mentioned below, you can also use Eclipse Classpath and Link with an external folder.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.