Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Disabling Java security manager on linux?

Please login with a confirmed email address before reporting spam

Hello,
I want to use my Java code under linux, that worked before under Windows. It seems that the Java security manager disables many things, among others creating any files. Running the code below from the command line (java -cp . test) produces the file in my home directory. When I run it from comsol, I get the message
access denied ("java.io.FilePermission" "/home/barna/comsol.test.out" "write")
How can I disable the security manager in comsol? (I am using comsmol 5.1)
Thank you
daniel

import com.comsol.model.*;
import com.comsol.model.*;
import com.comsol.model.util.*;
import java.io.*;

public class test
{
public static void main(String[] args) throws Throwable
{
try
{
PrintWriter pw = new PrintWriter("/home/barna/comsol.test.out");
pw.printf("Hello world\n");
pw.close();
}
catch(SecurityException t)
{
Message.show(t.getMessage());
}
}
}

1 Reply Last Post 2016年2月8日 GMT+1 11:02

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 2016年2月8日 GMT+1 11:02
Options > Preferences > Security
Uncheck "Enforce security restrictions"
Options > Preferences > Security Uncheck "Enforce security restrictions"

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.

Baidu
map