I have a studied java and self taught on netbeans. i would like to use open source APIs and packages for writing heuristics and machine learning programs but dont know where to start. How to learn to use a new API ? Like genetic algorithm package or metaheuristic package? I see code online and get overwhelmed by it

Hmm, if you want to use someone's code you need that .jar package.
For example if you want to read email in Java you need mail.jar.
From mail.jar you get some implemented classes and you don't need to worry about that just see how to use it.
You can see example how to use mail.jar in your project on this link.
You just write code and import Session, Store, Folder and other stuff from that mail.jar and you need just to write method to use it...
So I think that you want to do exactly that just with other code...