This content has been marked as final. Show 1 reply
You don't use import statements to grab stuff in jar files. import statements are just used to tell the compiler the full package names of classes.
To use a jar file, just put it in your classpath. For example, you might do it like this:
or other ways, depending on what you're trying to accomplish.
java -cp .;myJar.jar MyMainClass
You may use import statements if you want to alias long full class names. For example if the class "Documentation" is in the "i.dont.like.to.read.the" package, then you could do:
so that later in your code you could use Documenation without the full package name, like this:
Documentation notForMe = new Documentation();