0

I downloaded this library for low level Java keyboard hooks:

http://ksquared.de/blog/2011/07/java-global-system-hook/

It works great, but I want to attach the source to it. The source is included as .java files, but when I go to attach them to the library in eclipse it only wants a jar or zip file. I tried zipping the .java files but it didn't work. I've never attached a source before, can someone help me out?

durron597
  • 31,968
  • 17
  • 99
  • 158
gsgx
  • 12,020
  • 25
  • 98
  • 149
  • 1
    I'm pretty sure there's a way to attach sources by pointing to a folder. I haven't used Eclipse in years, so I do not remember where it is. When you zip source files, you need to zip the root of the namespace directory (`de`, in your case). – Sergey Kalinichenko Jan 21 '12 at 18:49
  • Ahh, I see. I thought only the folder with the files needed to be zipped, not the root. If you post this as an answer, I'll accept it. – gsgx Jan 21 '12 at 18:53
  • You don't actually need to zip them, see my answer below. – Francis Upton IV Jan 21 '12 at 18:56

1 Answers1

4

You can attach the source as either a zip file, a folder in the workspace or an external folder. In your project, right click and select Build Path -> Configure Build Path and then in the libraries tab find your library and expand it. There will be a line there about source attachment. On that like, hit the Edit button and then select the location of your source files.

Francis Upton IV
  • 19,322
  • 3
  • 53
  • 57
  • This doesn't work for me. It says "An internal error occurred during: "Setting build path"." The zip method works for me. – gsgx Jan 21 '12 at 21:37
  • You might want to look at the error log (Window -> Show View -> Error log) so see what caused that error. – Francis Upton IV Jan 21 '12 at 21:41