7

all

I can't change the default output folder in Eclipse.

When I open "Properties" -> "Java Build Path" -> "Source", the default output folder is

<project_name>/bin/classes

I changed it to

<project_name>/bin

save and clean-build this project. It changed back to

<project_name>/bin/classes

This happened after I updated my ADT plugin to 15.0.1

Some configurations:

Eclipse:
Eclipse IDE for Java Developers<br/>
Version: Indigo Service Release 1<br/>
Build id: 20110916-0149

ADT Version: 15.0.1.v201111031820-219398

OS: Mac 10.7.2

SCM: Git 1.7.4.4

Any suggestions are appreciated.

Thanks, Johnny

Johnny
  • 6,239
  • 7
  • 29
  • 36
  • I have the same problems. Looks like some kind of bug/limitation of ADT. As soon as I build the project, it changes the output folder setting. – Artem Dec 02 '11 at 23:35
  • I'm having this same problem, except that I'm trying to change my directory to war/WEB-INF/classes but it won't let me. And (I think because it wont' let me) I'm getting classdefnotfound errors. – Colleen May 03 '12 at 01:21

1 Answers1

6

From Android Changes in Revision 14:

Change to the bin output folder. While the Ant build system puts the output of javac in bin/classes/, the configuration of the Android projects in Eclipse uses bin/, like standard Java projects. This has always been a small problem because we put other files in there (like the apk and dex files), but also need to use this folder as the source of the dex step. Thankfully, dex would just ignore those files. Since we started putting resource items in there too (png crunch cache), we decided to change the project output (as far as the JDT is concerned) to bin/classes/. ADT still uses bin/ as its top-level output folder for Android specific files. The visible side effect is that bin/ will now show up in the Package Explorer view (but not bin/classes/ as JDT hides the only output folder it knows about).

This seems to imply that Android has it's own build settings and replaces the JDT build settings (i.e. "output folder" under Properties->Java Build Path->Sources) to match.

The blog "A Little Madness" describes how to change the out.dir property of ADT's Ant by adding/changing the file build.properties in your project's root folder. You can also change the location of gen.dir with build.properties.

out.dir=bin
gen.dir=gen

Note that Eclipse has had problems in the past with external tools modifying classes in its output folder, and its possible that out.dir=bin/classes for this reason.

Disclaimer: I haven't tried any of this, yet. This suggestion may fix nothing, cause different problems, or, hopefully, work.

Justin C
  • 640
  • 7
  • 11
  • This is the correct answer; building Android apps is NOT the same as building Java projects, and the structure of the output is decidedly different. – E-Riz May 05 '12 at 19:25
  • just to note that changing the output folders doesn't work when dealing with library projects - there's part of the Ant script that is hardcoded to look in the bin folder of libs anyway. – Richard Le Mesurier Oct 18 '12 at 06:56