当前位置:   article > 正文

java.lang.SecurityException: Security misconfiguration: cannot access java.io.tmpdir_java.lang.securityexception: writable dex file

java.lang.securityexception: writable dex file

在windows上搭建elasticsearch的时候,启动服务起不来
看日志报错如下信息:

[2023-10-31T16:56:21,138][ERROR][o.e.b.Bootstrap          ] [WNT123s] Exception
java.lang.SecurityException: Security misconfiguration: cannot access java.io.tmpdir
	at org.elasticsearch.bootstrap.Security.selfTest(Security.java:423) ~[elasticsearch-7.2.0.jar:7.2.0]
	at org.elasticsearch.bootstrap.Security.configure(Security.java:133) ~[elasticsearch-7.2.0.jar:7.2.0]
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:216) ~[elasticsearch-7.2.0.jar:7.2.0]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:349) [elasticsearch-7.2.0.jar:7.2.0]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) [elasticsearch-7.2.0.jar:7.2.0]
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) [elasticsearch-7.2.0.jar:7.2.0]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-7.2.0.jar:7.2.0]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) [elasticsearch-cli-7.2.0.jar:7.2.0]
	at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-7.2.0.jar:7.2.0]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115) [elasticsearch-7.2.0.jar:7.2.0]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) [elasticsearch-7.2.0.jar:7.2.0]
Caused by: java.lang.SecurityException: Unable to create temporary file or directory
	at java.nio.file.TempFileHelper.create(TempFileHelper.java:142) ~[?:?]
	at java.nio.file.TempFileHelper.createTempFile(TempFileHelper.java:160) ~[?:?]
	at java.nio.file.Files.createTempFile(Files.java:915) ~[?:?]
	at org.elasticsearch.bootstrap.Security.selfTest(Security.java:416) ~[elasticsearch-7.2.0.jar:7.2.0]
	... 10 more

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20

解决方案:
在这里插入图片描述

在这里插入图片描述
1、解压缩elasticsearch之后会出现一个jna–1391746105这个文件夹,找到它

在elasticsearch/bin目录中打开cmd命令框
输入:.\elasticsearch-service manager
在这里插入图片描述
找到如图所示-Djava.io.tmpdir=
jna–1391746105的路径填到这里就可以了

2、重启elasticsearch服务,成功解决

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/402190
推荐阅读
相关标签
  

闽ICP备14008679号