I need an xml file to be accessed via the classpath in a java application i am creating . how to achieve it in eclipse
I'd generate a separate resources folder, right-click it and select Build Path > Use as Source Folder
. That way it's on the class path, but you're not mixing it with your Java source files
将包含 XML的目录放在运行时类路径中,然后使用className.Class.getResourceAsStream()
来获取包含XML的InputStream。
将它放在java源文件夹中,并将其用作资源
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.