skylot/jadx · error · JadxRuntimeException
Failed to create temp directory with suffix: ${prefix}
Error message
Failed to create temp directory with suffix: ${prefix} What it means
Thrown by createTempDir(String prefix) when Files.createTempDirectory(tempRootDir, prefix) fails. This creates a temp directory under jadx's managed tempRootDir. Failure means the tempRootDir itself does not exist, is not writable, the prefix is invalid (contains path separators or illegal characters), or disk/inode space is exhausted. The method is deprecated in favor of IJadxFilesGetter.
Source
Thrown at jadx-core/src/main/java/jadx/core/utils/files/FileUtils.java:252
try {
deleteDir(clearDir, true);
} catch (Exception e) {
throw new JadxRuntimeException("Failed to clear directory " + clearDir, e);
}
}
/**
* Deprecated.
* Migrate to {@link IJadxFilesGetter} from jadx args to get temp dir
*/
@Deprecated
public static Path createTempDir(String prefix) {
try {
Path dir = Files.createTempDirectory(tempRootDir, prefix);
dir.toFile().deleteOnExit();
return dir;
} catch (Exception e) {
throw new JadxRuntimeException("Failed to create temp directory with suffix: " + prefix, e);
}
}
/**
* Deprecated.
* Migrate to {@link IJadxFilesGetter} from jadx args to get temp dir
*/
@Deprecated
public static Path createTempFile(String suffix) {
try {
Path path = Files.createTempFile(tempRootDir, JADX_TMP_PREFIX, suffix);
path.toFile().deleteOnExit();
return path;
} catch (Exception e) {
throw new JadxRuntimeException("Failed to create temp file with suffix: " + suffix, e);
}
}
View on GitHub (pinned to e738a26571)
Solutions
- Migrate to IJadxFilesGetter from jadx args as the deprecation notice advises.
- Ensure tempRootDir still exists before calling: FileUtils.isTempRootDirValid() or check Files.isDirectory(tempRootDir).
- Avoid path separators and OS-illegal characters in the prefix string.
- Verify free disk space and inodes on the temp filesystem.
Example fix
// before (deprecated)
Path dir = FileUtils.createTempDir("extract-");
// after — use IJadxFilesGetter from args
Path dir = args.getFilesGetter().createTempDir("extract-"); Defensive patterns
Strategy: validation
Validate before calling
public static boolean canCreateTempUnderRoot() {
try {
return Files.isDirectory(Path.of(System.getProperty("java.io.tmpdir")));
} catch (Exception e) {
return false;
}
} Try / catch
try {
Path dir = FileUtils.createTempDir(prefix);
} catch (JadxRuntimeException e) {
LOG.error("cannot create temp dir with prefix '{}': {}", prefix, e.getCause().getMessage());
throw e;
} Prevention
- Migrate from the deprecated method to IJadxFilesGetter from jadx args.
- Ensure the tempRootDir has not been cleared before calling.
- Avoid path separators and illegal characters in the prefix.
When it happens
Trigger: Calling createTempDir when tempRootDir was deleted or cleared between initialization and this call. The prefix string contains path separators or characters illegal for filenames. The temp filesystem is full or out of inodes. tempRootDir permissions changed after JVM startup.
Common situations: Calling this after clearTempRootDir() has removed the root. In a long-running jadx process where the OS cleaned up /tmp. Deprecated API usage in code that hasn't migrated to IJadxFilesGetter. Disk full in CI.
Related errors
- Failed to update temp root directory
- Failed to create temp root directory
- Failed to create temp file with suffix: ${suffix}
- Failed to create temp directory
- Can't create directory ${dir}
AI-assisted analysis of skylot/jadx@e738a26571 (2026-08-14).
Data as JSON: /api/errors/ae7b26135c6d96c5.
Report an issue: GitHub.