Java安全访问控制异常?

时间:2018-08-23 09:49:49

标签: java javafx jar javafx-8 executable-jar

我正在尝试构建JavaFX项目的.jar文件。该项目在IntellijIDEA上运行。当我尝试构建项目的可执行程序时,会遇到此错误。

**

Application Error
General Exception
Name: sample.Main
java.security.AccessControlException:acces denied
("java.util.PropertyPermission" "user.dir" "read")

**

详细信息

java.security.AccessControlException: access denied ("java.util.PropertyPermission" "user.dir" "read")
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at sun.plugin2.applet.FXAppletSecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at java.io.WinNTFileSystem.getUserPath(Unknown Source)
at java.io.WinNTFileSystem.resolve(Unknown Source)
at java.io.File.getAbsolutePath(Unknown Source)
at java.io.File.getAbsoluteFile(Unknown Source)
at org.sqlite.core.CoreConnection.open(CoreConnection.java:185)
at org.sqlite.core.CoreConnection.<init>(CoreConnection.java:76)
at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:25)
at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:24)
at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:45)
at org.sqlite.JDBC.createConnection(JDBC.java:114)
at org.sqlite.JDBC.connect(JDBC.java:88)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at sample.dataModel.DataSource.openDatabase(DataSource.java:98)
at sample.Main.init(Main.java:24)
at com.sun.javafx.applet.FXApplet2.init(FXApplet2.java:93)
at com.sun.deploy.uitoolkit.impl.fx.FXApplet2Adapter.init(FXApplet2Adapter.java:201)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

我的Java版本是1.8.0_181

There is my security properties

我该如何解决这个问题,请问有人可以帮助我吗?

1 个答案:

答案 0 :(得分:0)

如果在Linux或Mac上,请给程序管理员特权,如果在以adminstrator身份运行的Windows上,给用户sudo特权