menemukan nama jar berdasarkan nama class java

Asbaabuttulis [ sebab menulis ], want to know -> in which jar file or package is this file located


q> Dimana letak class JdbcOdbcDriver berada pada file jar yang mana, googling ketemu ini [1]

q> Langsung coba tes code

import sun.jdbc.odbc.JdbcOdbcDriver;
* @author saifi
public class NewClass {

public static void main(String[] args) {

Class namaClass = JdbcOdbcDriver.class;

URL location = namaClass.getResource('/' + namaClass.getName().replace('.', '/') + ".class");
System.out.println("Lokasi " + location.toString());


q> Jalankan dan hasilnya :



sumber [1] :


Published by


Begin a big Process with a bit trying

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s