what is my classpath?

hey guys. i have downloaded java spring project and i need some help finding what is the classpath of it. can smb help me out? theres no info on google. thx in advance
19 Replies
JavaBot
JavaBot7mo ago
This post has been reserved for your question.
Hey @bambyzas! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
dan1st
dan1st7mo ago
is it a Maven or Gradle project? What do you need the classpath for? What IDE are you using?
bambyzas
bambyzasOP7mo ago
gradle, intellij i need to specify path in my application.yaml to my keystore file for some reason the app still cant find the keystore file. in application.yamli have this line, the syntax is fine, but the app still cant pick the file: keystorePath: "/src/main/resources/keystore.jks". any ideas?
dan1st
dan1st7mo ago
change it to classpath:keystore.jks maybe? Also if it starts with /, it's an absolute path Why do you have your keystore in src/main/resources?
bambyzas
bambyzasOP7mo ago
for testing
dan1st
dan1st7mo ago
Just put it in the project directory and use keystorePath: keystore.jks?
bambyzas
bambyzasOP7mo ago
doesnt work :/
dan1st
dan1st7mo ago
Theoretically keystorePath: src/main/resources/keystore.jks should work but I wouldn't do that
bambyzas
bambyzasOP7mo ago
why?
dan1st
dan1st7mo ago
Because you shouldn't access stuff in the classpath like that as it doesn't work when moving stuff
bambyzas
bambyzasOP7mo ago
i dont get it
dan1st
dan1st7mo ago
You cannot rely on src/main/java always being available, especially when deploying it somewhere (e.g. as a JAR) Hence just put it next to the application and use keystorePath: keystore.jks Also what is the error you are getting?
bambyzas
bambyzasOP7mo ago
but i have two configs. one for dev env, other for prod
dan1st
dan1st7mo ago
that doesn't change anything you still don't need to write src/main/java/...
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
dan1st
dan1st7mo ago
There may be more classpath entry and classpath: is for classpath URLs
dan1st
dan1st7mo ago
Also ig it seems to work for this person: https://stackoverflow.com/a/25562938/10871900
Stack Overflow
How can I specify my .keystore file with Spring Boot and Tomcat?
I'm trying to set up Spring Security to work with Spring Boot's embedded Tomcat instance. There are quite a few basic samples that do this but I'm stuck where they leave off -- they do basic
Peter Rader
Peter Rader7mo ago
@bambyzas Do you have an domain?
JavaBot
JavaBot7mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Want results from more Discord servers?
Add your server