skylot/jadx · error · JadxRuntimeException
Failed to create temp file with suffix: ${suffix}
Error message
Failed to create temp file with suffix: ${suffix} What it means
Thrown by createTempFile(String suffix) when Files.createTempFile(tempRootDir, JADX_TMP_PREFIX, suffix) fails. The temp file is created under jadx's managed tempRootDir with a fixed 'jadx-tmp-' prefix. Failure causes: tempRootDir missing/unwritable, suffix contains illegal characters or path separators, disk full, or inode exhaustion. The method is deprecated.
Source
Thrown at jadx-core/src/main/java/jadx/core/utils/files/FileUtils.java:267
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);
}
}
/**
* Deprecated.
* Prefer {@link IJadxFilesGetter} from jadx args to get temp dir
*/
@Deprecated
public static Path createTempFileNoDelete(String suffix) {
try {
return Files.createTempFile(Files.createTempDirectory("jadx-persist"), "jadx-", suffix);
} catch (Exception e) {
throw new JadxRuntimeException("Failed to create temp file with suffix: " + suffix, e);
}
}
/**
* Deprecated.View on GitHub (pinned to e738a26571)
Solutions
- Migrate to IJadxFilesGetter from jadx args as the deprecation notice advises.
- Sanitize the suffix: strip path separators and OS-illegal characters.
- Ensure tempRootDir exists and is writable before calling.
- Monitor free disk space during long decompilation runs.
Example fix
// before (deprecated)
Path tmp = FileUtils.createTempFile(".dex");
// after — use IJadxFilesGetter
Path tmp = args.getFilesGetter().createTempFile(".dex"); Defensive patterns
Strategy: validation
Validate before calling
public static boolean isValidTempSuffix(String suffix) {
return suffix != null && !suffix.contains("/") && !suffix.contains("\\")
&& suffix.matches("[a-zA-Z0-9._-]*");
} Try / catch
try {
Path tmp = FileUtils.createTempFile(suffix);
} catch (JadxRuntimeException e) {
LOG.error("cannot create temp file with suffix '{}': {}", suffix, e.getCause().getMessage());
throw e;
} Prevention
- Migrate from the deprecated method to IJadxFilesGetter.
- Sanitize suffix strings to remove path separators and illegal characters.
- Ensure tempRootDir exists and is writable.
When it happens
Trigger: Calling createTempFile when tempRootDir was deleted. The suffix contains a path separator or illegal filename character. The temp filesystem is out of space or inodes. Permission on tempRootDir changed after startup.
Common situations: Calling after clearTempRootDir removed the root. Deprecated API usage not yet migrated. Large decompilation jobs exhausting temp disk. Invalid suffix string from dynamic configuration.
Related errors
- Failed to create temp directory with suffix: ${prefix}
- Failed to create non-prefixed temp file: ${fileName}
- Failed to update temp root directory
- Failed to create temp root directory
- Can't create directory ${dir}
AI-assisted analysis of skylot/jadx@e738a26571 (2026-08-14).
Data as JSON: /api/errors/419263d128da9cd1.
Report an issue: GitHub.