---
title: "获取类所引用的jar包"
author: "listen-raining"
date: "2014-09-04T11:35:45Z"
tags: []
categories: ["编程语言"]
slug: "jar"
draft: false
lastmod: "2014-09-04T11:35:45Z"
id: 2113218
url: "https://listen-raining.iteye.com/blog/2113218"
---

System.out.println("HWPFDocument类引用的jar包:"+HWPFDocument.class.getProtectionDomain().getCodeSource().getLocation());
		System.out.println("Range类引用的jar包:"+Range.class.getProtectionDomain().getCodeSource().getLocation());


打印：
HWPFDocument类引用的jar包:file:/C:/Users/tingyu/.m2/repository/org/apache/poi/poi-scratchpad/3.8-beta4/poi-scratchpad-3.8-beta4.jar
Range类引用的jar包:file:/C:/Users/tingyu/.m2/repository/org/apache/poi/poi-scratchpad/3.8-beta4/poi-scratchpad-3.8-beta4.jar