The issue is that $project_path variable (nor any other variable) is expanded to its value when used in env element, while $file works perfectly in cmd.At the same time $project_path works properly in cmd