How to get project path?

Hi, everyone

How to get project path by java code?

Have you tried something like this: ?


This is something I’ve been meaning to get my head around properly for yonks. It changes from system to system, server to server.

I’ve found it easiest some times writing a file to a local path then using the OS to search for it.

Here’s some light reading if you use spring.

Thanks everyone!)