Answers for "how to use classpath in spring boot"

1

load a file from classpath spring boot

public void testResourceFile() throws IOException {
		File resource = new ClassPathResource("test.json").getFile();
		String text = new String(Files.readAllBytes(resource.toPath()));
	}
Posted by: Guest on June-19-2020
0

how to add classpath in spring boot

java -cp aapName.jar -Dloader.path=/C:/extLib/ org.springframework.boot.loader.PropertiesLauncher-
Posted by: Guest on January-25-2021

Code answers related to "how to use classpath in spring boot"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language