diff --git a/generators/server/files.js b/generators/server/files.js
index <HASH>..<HASH> 100644
--- a/generators/server/files.js
+++ b/generators/server/files.js
@@ -22,6 +22,7 @@ var javaDir;
 function writeFiles() {
     return {
         cleanupOldServerFiles: function() {
+            javaDir = this.javaDir = constants.SERVER_MAIN_SRC_DIR + this.packageFolder + '/';
             cleanup.cleanupOldServerFiles(this, this.javaDir, this.testDir);
         },
Correctly set up javaDir variable (was undefined)