{"record":{"id":"937fb005486acb4d","repo":"JetBrains/intellij-community","slug":"temporary-file-doesn-t-exist-or-cannot-be-opened","errorCode":null,"errorMessage":"Temporary file doesn't exist or cannot be opened","messagePattern":"Temporary file doesn't exist or cannot be opened","errorType":"exception","errorClass":"CantRunException","httpStatus":null,"severity":"error","filePath":"java/java-impl/src/com/intellij/javadoc/JavadocGeneratorRunProfile.java","lineNumber":336,"sourceCode":"            String path = roots.map(MyJavaCommandLineState::localPath).collect(Collectors.joining(File.pathSeparator));\n            writer.println(\"-classpath\");\n            writer.println(StringUtil.wrapWithDoubleQuote(path));\n\n            if (!sourceRoots.isEmpty() && JavaSdkUtil.isJdkAtLeast(jdk, JavaSdkVersion.JDK_18)) {\n              //is needed for javadoc snippets only\n              String sourcePath = sourceRoots.stream().map(MyJavaCommandLineState::localPath).collect(Collectors.joining(File.pathSeparator));\n              writer.println(\"--source-path\");\n              writer.println(StringUtil.wrapWithDoubleQuote(sourcePath));\n            }\n          }\n        }\n\n        for (VirtualFile source : sources) {\n          writer.println(StringUtil.wrapWithDoubleQuote(source.getPath()));\n        }\n      }\n      catch (FileNotFoundException e) {\n        throw new CantRunException(JavaBundle.message(\"javadoc.generate.temp.file.does.not.exist\"), e);\n      }\n      catch (CantRunException e) {\n        FileUtil.delete(argsFile);\n        throw e;\n      }\n\n      myArgFileFilter.setPath(argsFile.getPath(), cs);\n      parameters.add(\"@\" + argsFile.getPath());\n      OSProcessHandler.deleteFileOnTermination(cmdLine, argsFile);\n      cmdLine.setCharset(cs);\n    }\n\n    private static @NotNull File createTempArgsFile() throws CantRunException {\n      File argsFile;\n      try {\n        argsFile = FileUtil.createTempFile(\"javadoc_args\", null);\n      }\n      catch (IOException e) {","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/java-impl/src/com/intellij/javadoc/JavadocGeneratorRunProfile.java#L318-L354","documentation":"The runner writes the javadoc argument list into a temp args file (referenced via '@argsFile' on the javadoc command line, since command lines can exceed OS limits). If opening that freshly created file for writing throws FileNotFoundException, it is wrapped in CantRunException('Temporary file doesn't exist or cannot be opened'). On a normal system this only happens if the file vanishes between creation and open, or the temp directory denies access.","triggerScenarios":"createTempArgsFile succeeded but new FileOutputStream(argsFile) throws FileNotFoundException — the temp dir (java.io.tmpdir) was cleared, is read-only, full quota, or an antivirus/lock deleted the file instantly.","commonSituations":"Disk-full conditions on the temp partition; aggressive tmp cleaners (systemd-tmpfiles, CI containers with small tmpfs); security software removing the just-created file; exotic sandboxes where java.io.tmpdir points somewhere unwritable.","solutions":["Free space / permissions on the temp directory and retry generation.","Point java.io.tmpdir elsewhere via Help | Edit Custom VM Options: add -Djava.io.tmpdir=/path/to/writable/dir and restart.","Disable or whitelist the tmp-cleaning/security tool for the IDE temp directory."],"exampleFix":"# help > edit custom vm options\n# before (default)\n# (java.io.tmpdir unset, points at cleaned /tmp)\n\n# after\n-Djava.io.tmpdir=/home/user/idea-tmp","handlingStrategy":"fallback","validationCode":"File tmp = new File(System.getProperty(\"java.io.tmpdir\"));\nif (!tmp.canWrite() || tmp.getFreeSpace() < 50L * 1024 * 1024) { /* redirect or warn before generation */ }","typeGuard":null,"tryCatchPattern":"try { generateJavadoc(...); } catch (CantRunException e) { if (e.getMessage().contains(\"Temporary file\")) { cleanOrRedirectTmp(); retryOnce(); } }","preventionTips":["Keep the temp directory writable with free space","Set -Djava.io.tmpdir to a stable private directory for the IDE","Whitelist the IDE temp dir in antivirus/tmp-cleaner tools"],"tags":["javadoc","temp-file","filesystem","environment"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}