views:

28

answers:

2

I'm quite happy to rig up a bash script to do this, but it would nice to have an automated tool to sort java files into the correct directories (after creating them).

Thanks!

+1  A: 

Can I ask what you mean by "sort java files into the correct directories (after creating them)" ? In Java if package structure and directory structure or not same, it wont allow you to compile.

In effect, if you want to organize classes, you use Eclipse IDE (or any other IDE for that matter) select a bunch of classes and say "Move" specificy the package names and it will automatically move them to the appropriate packages (and physical directories)

Calm Storm
Exactly - it currently doesn't compile.As for manually specifying the move in eclipse, this is exactly what I *don't* want to do -- there are hundreds of classes.
In eclipse you can click on the error and accept the option to move to the correct package (Ctrl + 1 being the shortcut). For hundreds of classes this can be a pain. You can select "multiple" files at one shot and move it to the package of interest. Beyond that I guess, you are better off with your shell scripts
Calm Storm
+1  A: 

Eclipse should tell you when a file is not in the appropriate package. You can then use the quick fix option of the problem view to move the files in the right directory.

Manuel Darveau