The path for classes different on windows machine

Hi, I am new to gradle and looking for help.
In our Java project ( source code under src/main/java/… non-multi-project-build ) In one of the JavaExec task , need to pass the classes path as an argument. On CentOs, the path is 'build/classes/java/main/" where as on windows ( eclipse buildship ) it is “build/classes/main”; Is it expected? Do i have to set this path based on OS check?

Could you please suggest.

You are running with different Gradle versions. Please make sure you are using the Gradle wrapper, so every user has the same Gradle version for the project.

Also, don’t hardcode paths, just use sourceSet.main.runtimeClasspath. That way you are independent of future changes to Gradles build layout.

Thanks for response. The gradle on CentOs is 4.3 and Buildship using gradle 3.5; I did few changes as you suggested. It is working. Also removed hard coding of paths.