How to add build output to application 'run' classpath on gradle project

I am working on a gradle project and am having more than a little difficulty with getting intellij to cooperate.

I have finally been able to get the project building using the correct build configurations, but when I try and run a main program by right-clicking and selecting run, it builds (correctly using gradle) and tries to run it, but the command line does not include the build output directories in the classpath.  I have gone into the module settings and tried to add the build/classes/main folder to the module dependencies, but they still don't end up where they should be (even when having them as a runtime dependency).  I would think that by default it would include the projects build-output directory in the classpath, but it doesn't.

I'll try and see if I can create a smaller sample project, but the current gradle integration seems to be very poor at this point and it seems to be non-trivial to setup a gradle project that actually works.

Comment actions Permalink

Hi James,

That is a known problem - IDEA-91952. At the moment, suggested way is to build/run using IDE setup (check Szczepan's comment at the mentioned ticket).


Comment actions Permalink

I downloaded the 12.1 EAP and after re-importing the project, I seem to be able to run applications correctly after tweaking a few settings.


Please sign in to leave a comment.