1. 程式人生 > >java 查看類是從哪個jar包加載的

java 查看類是從哪個jar包加載的

-h -m cati 查看類 加載 apache color obj ack

package com.jason

object FIndjar {
  def main(args: Array[String]): Unit = {
    val pd = classOf[org.apache.hadoop.mapreduce.TaskID].getProtectionDomain
    println("===="*30)
    val cs = pd.getCodeSource
    System.out.println(cs.getLocation)
  }
}



------------------------------
file:
/C:/notos/software/spark/spark-2.1.0-bin-hadoop2.6/jars/hadoop-mapreduce-client-core-2.6.4.jar

java 查看類是從哪個jar包加載的