How i can avoid a java file getting into a jar folder during build

how i can avoid a java file getting into a jar folder during build

Please take some time to describe your problem, and your attempts to solve it, in more detail.

i’m having 4 java files in a single folder which is named as x, i need only two of java files to be executed and get stored as a class file in a jar folder but the prob is other two java files in the folder x which is not executed is getting into the jar file i need to avoid it those two java files getting into the jar folder … How can i do it

It isn’t entirely clear to me what you are trying to achieve, and what the context is. Perhaps you want something like:

jar {
  exclude "some/package/ClassA.class"
  exclude "some/package/ClassB.class"
}

i’m executing two java files in a folder and i’m getting corresponding class files for that in a jar folder but some other java files which is not executing is also getting into that jar folder… i need to avoid those java files which is not executed…

Sorry, that’s not clear enough for me to suggest a solution. Perhaps you could describe the problem more concretely, e.g. by showing the relevant parts of your build script.