This is probably the most well-known page describing implementation of Perlin noise - it has all you need, you just need to put a bit of effort into understanding it.
If you are in Java and want ready-to-use solution, you could also use the noise generator implemented in Java3D. There are also many more Perlin noise implementations floating around the web.
I personally prefer the diamond-square algorithm to the Perlin noise. It tends to generate less axially biased noise (that terrain features are suspiciously parallel to either of the main axes, creating visually distracting elements).