How to get names of classes inside a jar file?

How to get names of classes inside a jar file?

How to convert an ArrayList containing Integers to primitive int array?