很简单,使用一个第三方的工具JavaService就可以了,地址是http://forge.ow2.org/projects/javaservice/ 转载于:https://blog.51cto.com/howfar/1320246