The file is placed in the Resources folder and will appear in the boot after it is typed as a jar package_ INF/classes/ xx.xx The second one is the second one;
The file path uses “absolute path”/ xx.xx “, load URL and create InputStream with classloader:
URL fileURL=this.getClass().getResource("/xx.xx");
InputStream is=this.getClass().getResourceAsStream("/resource/res.txt");
Read More:
- Zip to decompress the jar package, like the add file in the jar package
- When Maven hits the jar package, an error is reported when executing install, and the symbol cannot be found in a line
- Failed to get the resources path in the jar package, reporting an error null pointer
- [SharePoint] after deploying webpart, the solution to the resource file in the layouts mapping directory referenced by webpart cannot be found
- Shrio | java.io.IOException: Resource [classpath:shiro.ini] could not be found
- How to select the jar package version for Maven package when the jar package versions referenced by multiple modules are inconsistent
- When using exe4j to generate exe executable file from jar, no JVM could be found on your system exception appears
- Does the version of idea2020.1 import mybayis jar package or report an error? Error: (4,28) Java: package org.apache.ibatis.io does not exist
- 26、Error:No resource identifier found for attribute ’roundIcon’ in package ‘android’
- The introduction of third-party jar package in mavn project results in classnotfoundexception
- Update project manually_ Solution of too large jar package in springboot
- zookeeper Failed to Startup: Error: JAVA_HOME is not set and java could not be found in PATH
- The shell runs the class file and imports the jar package that the class depends on
- Java cpp-0.11.jar, opencv-windows-x86_ 64.jar,opencv-2.4.11-0.11.jar
- Research on Maven management of Java project pom.xml The jar package error is reported, but the project is running normally
- [Solved] Scala signature package has wrong version expected: 5.0 found: 5.2 in package.class
- How to turn your project into a jar package in idea
- Wrong path to add PCH file. Apple llvm 9.0 – language cannot be found in the new project
- java.lang.IllegalStateException: ArrayAdapter requires the resource ID to be a TextView
- Vs2017 reported an error. Pthread. H header file cannot be opened and cannot be found