Relative path problem when java project is running

insert image description here
A font was introduced, and the path selected at that time was /resource/font/GB2312.ttf. The file was not found.
Later, I knew that the relative path was viewed in the packaged directory, so the directory under the target was selected. problem solved

Guess you like

Origin blog.csdn.net/weixin_41858523/article/details/129285859