I have stored all the jar file into specific folder. How to configure specific folder to Jshell classpath ? [duplicate]

旧城冷巷雨未停 提交于 2019-12-14 03:07:09

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!