views:

60

answers:

1

I have the following line to play a sound clip :

Applet.newAudioClip(new URL("file:/C:/Dir_Sound/music.au")).play()

it works in standalone app, but in jnlp I got an error message :

java.security.AccessControlException: access denied (java.io.FilePermission C:/Dir_Sound/music.au read)

I'm not running it in "all-permissions mode", is there another way to play the sound file ?

PS : The sound file is selected by the user on his computer when the program runs, I can't embed it in my jar.

+1  A: 

Embed the file into your Web Start app. Put a <resources> element with a jar in your JNLP file. To access it, use getClassLoader().getResource.

Matthew Flaschen