Reputation: 3219
Eclipse complains if I add source folder as a class folder in Java Build Path / Library.
I need this for GWT that requires sources to be in the classpath. One solution is to manually add source folders of all projects to classpath of the launch configuration, but this is not suitable for me because of specific reasons.
Another solution would be to tell Eclipse to copy all *.java
files to bin
folder (as it does for other resources), but I can't achieve this too.
Upvotes: 0
Views: 1514
Reputation: 3219
I've found the solution - to add Ant builder to all projects pointing to the following ant file:
<project name="Copy Sources" basedir="." default="copy-src">
<target name="copy-src">
<copy todir="bin">
<fileset dir="src" includes="**/*.java"/>
</copy>
</target>
</project>
My .project files look like this:
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>my-project1</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>auto,full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value><?xml version="1.0" encoding="UTF-8"?>
<launchConfiguration local="false" path="/gwt-dev-support/Copy Sources.launch"/></value>
</dictionary>
<dictionary>
<key>incclean</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Upvotes: 0
Reputation: 13858
Are you using the GWT plug-in by Google (http://code.google.com/eclipse/docs/getting_started.html). Although I have not used it, a collegue of mine did, and I am reasonably sure it handles this kind of java code in the classpath issue.
Upvotes: 1