TempFileHelper java.lang.IllegalArgumentException: Invalid prefix or suffix

Michael Hall mik3hall at gmail.com
Tue Aug 31 15:59:13 UTC 2021



> On Aug 31, 2021, at 10:52 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> 
> 
> 
> On 31/08/2021 16:24, Michael Hall wrote:
>> I am getting this error on code running on a recently downloaded 18 ea.
> 
> 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.
> 
>> First question. Is “Invalid prefix or suffix” really the best error message for this?
> A consequence of running with a security manager is that exceptions need to be careful to avoid leaking sensitive data, in this case the location of temporary files. So yes, this message is deliberate.

I think the actual nature of the error could be indicated without revealing the location of the files. 

The current jpackage invocation follows…

${PACKAGER} \
	--verbose \
	--input input \
	--icon GenericApp.icns \
	--resource-dir resources \
	--name HalfPipe \
	--main-jar halfpipe.jar \
	--main-class us.hall.hp.common.LoaderLaunchStub \
	--module-path mods \
 	--add-modules us.hall.eio,org.openjdk.nashorn,java.compiler,java.desktop,java.logging,java.management,java.prefs,java.se,java.rmi,java.scripting,java.sql,java.xml,jdk.attach,jdk.jshell,jdk.crypto.ec,jdk.jdeps,jdk.jcmd \
	--java-options '-Xmx1024m -XX:+UseG1GC -XX:MaxGCPauseMillis=50 -Djava.nio.file.spi.DefaultFileSystemProvider=us.hall.trz.osx.MacFileSystemProvider --add-exports org.openjdk.nashorn/org.openjdk.nashorn.tools=ALL-UNNAMED -Dapp.path=$APPDIR -Djava.security.policy=$APPDIR/all.policy -Dapple.laf.useScreenMenuBar=true -Dcom.apple.mrj.application.apple.menu.about.name=HalfPipe -Dapple.awt.application.name=HalfPipe -Dconsole=pane' \
	--mac-package-identifier "us.hall.HalfPipe" \
	--mac-sign \
	--mac-signing-key-user-name "$SIGNING_CERT" \
	--mac-entitlements "entitlements.xml" \
	--jlink-options '--strip-debug --no-man-pages --no-header-files' 



More information about the nio-dev mailing list