title: Intellij can't run Wildfly server
body: <p>I'm trying to get Intellij IDEA to work with a Wildfly 10 server. I installed Intellij following <a href="https://doc.ubuntu-fr.org/utilisateurs/blackeco/brouillon-intellij#installation" rel="nofollow noreferrer">this</a> and Wildfly thanks to <a href="https://gist.github.com/sukharevd/6087988" rel="nofollow noreferrer">this script</a>.</p>
  
  <p>The startup script used by Intellij is /opt/wildfly-10.0.0.Final/bin/standalone.sh, which I tried to run manually, and I got the following error : </p>
  
  <pre><code>    =========================================================================
  
    JBoss Bootstrap Environment
  
    JBOSS_HOME: /opt/wildfly
  
    JAVA: /usr/lib/jvm/java-1.8.0-openjdk-amd64/bin/java
  
    JAVA_OPTS:  -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true
  
  =========================================================================
  
  java.lang.IllegalArgumentException: Failed to instantiate class "org.jboss.logmanager.handlers.PeriodicRotatingFileHandler" for handler "FILE"
      at org.jboss.logmanager.config.AbstractPropertyConfiguration$ConstructAction.validate(AbstractPropertyConfiguration.java:116)
      at org.jboss.logmanager.config.LogContextConfigurationImpl.doPrepare(LogContextConfigurationImpl.java:335)
      at org.jboss.logmanager.config.LogContextConfigurationImpl.prepare(LogContextConfigurationImpl.java:288)
      at org.jboss.logmanager.config.LogContextConfigurationImpl.commit(LogContextConfigurationImpl.java:297)
      at org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:546)
      at org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:97)
      at org.jboss.logmanager.LogManager.readConfiguration(LogManager.java:514)
      at org.jboss.logmanager.LogManager.readConfiguration(LogManager.java:476)
      at java.util.logging.LogManager$3.run(LogManager.java:399)
      at java.util.logging.LogManager$3.run(LogManager.java:396)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:396)
      at java.util.logging.LogManager.access$800(LogManager.java:145)
      at java.util.logging.LogManager$2.run(LogManager.java:345)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.util.logging.LogManager.ensureLogManagerInitialized(LogManager.java:338)
      at java.util.logging.LogManager.getLogManager(LogManager.java:378)
      at org.jboss.modules.Main.main(Main.java:482)
  Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      at org.jboss.logmanager.config.AbstractPropertyConfiguration$ConstructAction.validate(AbstractPropertyConfiguration.java:114)
      ... 17 more
  Caused by: java.io.FileNotFoundException: /opt/wildfly/standalone/log/server.log (Permission non accordée)
      at java.io.FileOutputStream.open0(Native Method)
      at java.io.FileOutputStream.open(FileOutputStream.java:270)
      at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:213)
      at org.jboss.logmanager.handlers.FileHandler.setFile(FileHandler.java:151)
      at org.jboss.logmanager.handlers.PeriodicRotatingFileHandler.setFile(PeriodicRotatingFileHandler.java:102)
      at org.jboss.logmanager.handlers.FileHandler.setFileName(FileHandler.java:189)
      at org.jboss.logmanager.handlers.FileHandler.&lt;init&gt;(FileHandler.java:119)
      at org.jboss.logmanager.handlers.PeriodicRotatingFileHandler.&lt;init&gt;(PeriodicRotatingFileHandler.java:70)
      ... 22 more
  java.util.concurrent.ExecutionException: Operation failed
      at org.jboss.threads.AsyncFutureTask.operationFailed(AsyncFutureTask.java:74)
      at org.jboss.threads.AsyncFutureTask.get(AsyncFutureTask.java:268)
      at org.jboss.as.server.Main.main(Main.java:103)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.jboss.modules.Module.run(Module.java:329)
      at org.jboss.modules.Main.main(Main.java:507)
  Caused by: org.jboss.msc.service.StartException in service jboss.as: Failed to start service
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: java.lang.IllegalStateException: WFLYDR0006: Directory /opt/wildfly/standalone/data/content is not writable
      at org.jboss.as.repository.ContentRepository$Factory$ContentRepositoryImpl.&lt;init&gt;(ContentRepository.java:188)
      at org.jboss.as.repository.ContentRepository$Factory.addService(ContentRepository.java:154)
      at org.jboss.as.server.ApplicationServerService.start(ApplicationServerService.java:146)
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
      ... 3 more
  </code></pre>
  
  <p>This is exactly the same I get as output in Intellij.</p>
  
  <p>I found thanks to <a href="https://stackoverflow.com/questions/36808645/error-when-starting-wildfly-10-on-linux-filenotfoundexception">this topic</a> that it may be a matter of user permissions. </p>
  
  <p>However, when I try to add a user to wildfly with the add-user.sh script, I get this error : <code>./add-user.sh: 1: eval: /usr/lib/jvm/jdk1.8.0_60/bin/java: not found</code></p>
  
  <p>It is looking for a wrong JDK path. I tried to change it following different solutions but none of them work.</p>
  
  <p>My JAVA_HOME is set to <code>/usr/lib/jvm/java-8-oracle</code> .</p>
  
  <p>Is any of you having an idea of what to do ? Thank you in advance :)</p>