在项目中用到System.getProperty(“user.dir”),但是显示的路径是eclipse的workspace的路径?
双击或F3打开tomcat server,

在General Information中点击Open launch configuration,

然后选择Arguments,

最下面的Work directory,
在other中选择tomcat中bin文件夹的路径,eg:

j:\development-tool-00\apache-tomcat-8.5.32\bin
解决在Eclipse中使用System.getProperty(user.dir)时显示的是workspace路径而非Tomcat路径的问题。通过修改Tomcat的启动配置,指定正确的bin目录,确保应用程序在正确的工作目录下运行。
4825

被折叠的 条评论
为什么被折叠?



