1

I have a Java program connected with MySQL database. I'm trying to debug my program and I get the following error:

Source not found The JAR file C:\Users..\mysql-connector-java-5.1.20-bin.jar has no source attachement. You can attach the source by clicking attach source below:

I have add a package that contains mysql-connector-java-5.1.20-bin.jar and there is a folder named src inside the package. The connection with the DB is done successfully.

What could be the problem ?

Jury A
  • 19,192
  • 24
  • 69
  • 93

1 Answers1

1

If you need/want to step into some method of your driver during the debug session, your IDE will need the source. In NetBeans you can add the sources in the library configuration. In Eclipse I think that this is available too. Take a look here: Eclipse: Attach source/javadoc to a library via a local property

Community
  • 1
  • 1
davidbuzatto
  • 9,207
  • 1
  • 43
  • 50
  • Ok. The source is available. I'm using Eclipse. I went to Project-> Properties -> Add External JARs. And I pointed to the .jar file that src folder in the same directory. – Jury A Aug 17 '12 at 22:01
  • This way your IDE will not be able to see the sources. I'm not an Eclipse expert. I'm opening it here to see what you need to do. – davidbuzatto Aug 17 '12 at 22:03
  • I found a tutorial, take a look. – davidbuzatto Aug 17 '12 at 22:14
  • The jar (`mysql-connector-java-5.1.20-bin.jar`) you mentioned seems like a binary jar. you need to include the corresponding source `mysql-connector-java-5.1.20-src.jar` in your eclipse-workspace. – Satish Pandey Aug 18 '12 at 04:47