Change limit nomber of open files

when I am running a gradle job on jenkins ( linux ubuntu 22.04), I get Error: EMFILE: too many open files,

the problem is
ulimit -n
ulimit -s

I tried to change these values from

  • soft nproc unlimited
  • hard nproc unlimited
  • soft nofile 65536
  • hard nofile 65536

Since I have last jenkins version 2.346.2 , I read I need to add
systemctl edit jenkins

but i still get ulimit 4096 in jenkins job, any idea what is the problem please