Open Source Implementation of 3D Thinning algorithm
If you would be happy with 3D skeleton and are looking for a Java implementation, there a popular image processing package in Life Science called ImageJ. In a distribution of ImageJ called Fiji, you will find a solid implementation by Ignacio Arganda-Carreras.

Check here: http://fiji.sc/wiki/index.php/Skeletonize3D. You will find a link to the source as well as links to tutorials.

Here is video describing how to use it from with the Fiji software: http://fiji.sc/wiki/index.php/Skeleton_analysis_video_tutorial