Eclipse default output folder not changed

Hi All,

I am using gradle 4.5.1 and eclipse neon and tomcat 7.0.47.
I have changed eclipse default output folder:

eclipse { classpath { downloadJavadoc = true downloadSources = true defaultOutputDir = file('bin/main')

but when i use rootProject.projectDir in my java file it is giving me path till bin folder.
Either it should give path till workspace which it prints on commandline or it should give till main folder as i have changed defaultOutputDir .

I dont understand why does it do this?