问题
I have stored all the jar file into specific folder and I have added specific folder to Jshell classpath. I am unable to import packages in jshell
after adding classpath.
It is working fine If I have mentioned all the jar file name in classpath. I don't want to mentioned all the Jar file name in classpath because I have to add more than thousand number of jar files into classpath.
How to configure specific folder to Jshell classpath ?
回答1:
Declare the path of classpath in jshell.
jshell> /env -class-path path_of_dependecies
If classpath is current working folder
jshell> /env -class-path .
When you call specific class or call static method from dependencies, you must use command import
jshell> import com.foo_company.*
See authoritative tutorial http://cr.openjdk.java.net/~rfield/tutorial/JShellTutorial.html#setting-a-classpath
来源:https://stackoverflow.com/questions/51572135/i-have-stored-all-the-jar-file-into-specific-folder-how-to-configure-specific-f