That would be one solution, but not a good one. If you have to go that way you'd need to set the codeBase to restrict permissions.
Try signing the jar file.
Type: Posts; User: Norm
That would be one solution, but not a good one. If you have to go that way you'd need to set the codeBase to restrict permissions.
Try signing the jar file.
If it works for all folders except the desktop, then check the OS's settings for the reason.
This code works:
try {
File fo = new File("C:/users/" +...
I think that is controlled by the OS. Nothing to do with java.
I changed the path to my desktop and get the same error now.
See post#42
Please post a complete program that compiles, executes and shows the problem for testing.
Does that file path exist?
What error message do you get with the code in post#43?
Sorry, I don't know what problems the OS can cause when accessing different folders.
If the program works with some files and folders and not others, then the OS could be causing the problem.
What is there about that file, its state and the OS that would cause the error?
Can you make a small simple program that compiles, executes and shows the problem for testing?
By app I mean a program that is executed using the java command and that executes without requiring permissions. Code that is not an applet.
I don't see anything about permission. Try the code in an app to see what happens there.
Not sure that error has anything to do with the code being in an applet.
Try writing a small simple app with the code that created the error.
Why would there be a problem renaming a file?
There isn't one until you create it. Use the policytool program to create one and save it to the user.home folder.
What is the "it" that you did not find?
Google .java.policy and read the doc all about it.
Correction: the file is in the user.home folder. Use this to find it:
...
Add what to the applet?
How can the applet carry its permissions with it? Wouldn't that make security useless?
The .java.policy file is used by the java program to grant permissions to...
My applets that require permission are only executed on my pc. I use the .java.policy file to grant permissions.
Here is a sample of my .java.policy file:
I use the policytool to edit it. It is...
The applet does not have the permission it needs.
I've never used JNLP. I've only used the <applet tags.
Chrome and Firefox
Mine comes in the upper left of the screen when I open a page with an applet.
Where did you look?
There is a setting via the Java icon in the Control Panel on Windows.
What is shown in the browser's java console?
what is the "it"?
You were able to sign the jar file in 20 minutes?
How do you use a jar file with AppletViewer?
Ask google. Signing a jar is a multi-step process.
See the tutorial: http://docs.oracle.com/javase/tutorial/deployment/deploymentInDepth/runAppletFunction.html
What is the applet simulator?