I need to import a Java class in my project. The class I need to import is in a JAR file with
absolute path ~/Documents/mylib/stdlib.jar
Now in my source file (Test.java) I am using
import stdlib.*;
and I am compiling with
javac -classpath ~/Documents/mylib/stdlib.jar Test.java
And it is showing the error that stdlib does not exist.
Is my import statement correct or is there anything wrong with classpath? Shouldn't this import statement import all the classes present in the JAR file?
I am not using any IDE and my OS is Linux.