0

I'm a beginner java programmer, and I wanted to try out JSoup. However, when I import it into Eclipse, I get the error: source not found and a message at the top. Screen

It says to attach a source, but I'm not exactly sure what I'm supposed to attach. Also, I'm on a Mac. Thanks, and sorry if I used the wrong terms.

axu08
  • 29
  • 1
  • 7
  • jar files only contains .class files and not the source code. so when you include a jar file in your project no source code is attached to it. You must be trying to navigate to a Class by clicking the hyperlink in Eclipse. Either attach the source code or install a decompiler in eclipse plugins. Please have a look at below link https://stackoverflow.com/questions/15180411/attach-the-source-in-eclipse-of-a-jar – Asad Oct 12 '21 at 07:54
  • You've jumped into 3rd year college computer science 300 level tutorials, without taking the pre-requisite 101 and 201 level classes: "Computer Science 101 - Java Programs" through "202 IDE's and Library imports". 300 level classes start AFTER you have your 4 year bachelors degree in computer science from respected university. If you're serious about becoming a programmer, then square 1 is computer science degree from University. Don't let the intimidating wall of getting started intimidate you. You've picked one of the hardest professions in the world, and you've started half way through. – Eric Leschinski Oct 24 '21 at 19:46

1 Answers1

0

I recommend you create a Maven project and declare the following dependency in the pom.xml:

<!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
<dependency>
    <groupId>org.jsoup</groupId>
    <artifactId>jsoup</artifactId>
    <version>1.14.3</version>
</dependency>

enter image description here

You can learn more about creating a Maven project in Eclipse from this tutorial.

Arvind Kumar Avinash
  • 71,965
  • 6
  • 74
  • 110