0

I am trying to use the repository MySQL. The first instruction in the tutorial tells me to put the repo into my project in my workplace. Then, it tells me I can access it immediately using MySQL as a type, like other objects and what not. However, it seems that I cannot access the repo what-so-ever.

What is the correct way to go about importing a repository into my current project?

5
  • Possible duplicate of Importing a GitHub project into Eclipse Commented Jan 12, 2017 at 4:10
  • It is not the same question. That just explains how to import a repo into an Eclipse environment. I'm talking about importing the repo and then being able to use it in my current project. Commented Jan 12, 2017 at 4:12
  • 1
    Try Project > Properties > Java Build Path > Projects > Add... > Select the repo project Commented Jan 12, 2017 at 4:13
  • 1
    @shmosel from the language the OP used I understand that he's not refering to git. Rather simply import by hard copy. Commented Jan 12, 2017 at 4:13
  • Btw if all you want is just to connect to your MySQL server you should rather use Connector/J (included in installation). Otherwise cloning should be used if you want to contribute IMHO. Commented Jan 12, 2017 at 6:03

1 Answer 1

1

You have to add it to the classpath, so the JVM knows to look for it.

Right click on the file and select "Add to Build".

Sign up to request clarification or add additional context in comments.

5 Comments

Right click on the "file". Is this the cloned repository directory? My apologies, but I'm fairly unfamiliar with the Java and the Eclipse environment, being a Javascript and Python developer myself, so if you could hold my hand a bit and add some more detail to the post, that'd be awesome.
Not in front of my PC, usually deal with jars this way. Almost certain the same is with the cloned directory.
Oh just thought about it. You should set the source directory as the build path. Otherwise the compiler will complain about wrong package names (as all parent directories until src are mistaken for part of the packaging).
I think eclipse should have an option "set as source folder". You should use this option instead. Lemme know if it helps, i'll update answer to reflect that.
One more thing to note, you can make that a completely separate project and set you project as dependent on the other. Look for the option "configure build path" for doing this.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.