TempFileHelper java.lang.IllegalArgumentException: Invalid prefix or suffix

Michael Hall mik3hall at gmail.com
Tue Aug 31 17:27:55 UTC 2021



> On Aug 31, 2021, at 11:28 AM, Michael Hall <mik3hall at gmail.com> wrote:
> 
> 
> 
>> On Aug 31, 2021, at 10:59 AM, Michael Hall <mik3hall at gmail.com <mailto:mik3hall at gmail.com>> wrote:
>> 
>>> Do you see this with other JDK releases too? Is it possible that java.io.tmpdir has been set on the command line?
>> 
>> I haven’t tried this yet. It means invoking jpackage indicating a earlier jdk. I can do this. Since I’ve sort of gathered 17 and 18 changes are sort of going in parallel right now I’ll try to go back to 16.
> 
> When you have some things working it’s not all that easy to fall back to where they were broken. 
> But, yes, just changing to jdk16 and it works. No error.
> Changing to 17 at this point would be easy if you want me to try that?
> 

Slightly different results…

public class SecTemp {

	public static void main(String... args) throws java.io.IOException {
		System.setSecurityManager(new SecurityManager());
		java.io.File tmpfile = java.nio.file.Files.createTempFile("AppleScriptEngine.", ".scpt").toFile();
	}
}

java SecTemp      
WARNING: A terminally deprecated method in java.lang.System has been called
WARNING: System::setSecurityManager has been called by SecTemp (file:/Users/mjh/)
WARNING: Please consider reporting this to the maintainers of SecTemp
WARNING: System::setSecurityManager will be removed in a future release
Exception in thread "main" java.lang.SecurityException: Unable to create temporary file or directory
	at java.base/java.nio.file.TempFileHelper.create(TempFileHelper.java:141)
	at java.base/java.nio.file.TempFileHelper.createTempFile(TempFileHelper.java:159)
	at java.base/java.nio.file.Files.createTempFile(Files.java:923)
	at SecTemp.main(SecTemp.java:6)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20210831/5427b23c/attachment.htm>


More information about the nio-dev mailing list