diff --git a/generators/cleanup.js b/generators/cleanup.js
index <HASH>..<HASH> 100644
--- a/generators/cleanup.js
+++ b/generators/cleanup.js
@@ -221,11 +221,13 @@ function cleanupOldServerFiles(generator, javaDir, testDir, mainResourceDir, tes
         generator.removeFile(`${testDir}web/rest/ClientForwardControllerIT.java`);
     }
     if (generator.isJhipsterVersionLessThan('6.6.1')) {
-        generator.removeFile(`${javaDir}security/oauth2/JwtAuthorityExtractor.java`);
         generator.removeFile(`${javaDir}web/rest/errors/EmailNotFoundException.java`);
         generator.removeFile(`${javaDir}config/DefaultProfileUtil.java`);
         generator.removeFolder(`${javaDir}service/util`);
     }
+    if (generator.isJhipsterVersionLessThan('6.8.0')) {
+        generator.removeFile(`${javaDir}security/oauth2/JwtAuthorityExtractor.java`);
+    }
 }
 
 /**
Move clean file 'JwtAuthorityExtractor' for older version than <I>