title: run spring boot with java -jar with tools.jar as dependency
body: <p>I am trying to run a springboot app that needs tools.jar as a dependency, I runned "mvn package spring-boot:run" and everything goes ok, but after packaging with "mvn package spring-boot:repackage" and running with java -jar the generated boot.jar the throws the following error </p>
  
  <pre><code>java -jar "site-0.1.0-spring-boot.jar" 
  Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/tools/attach/AttachNotSupportedException
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
      at java.lang.Class.getDeclaredMethod(Unknown Source)
      at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
      at java.lang.Thread.run(Unknown Source)
  Caused by: java.lang.ClassNotFoundException: com.sun.tools.attach.AttachNotSupportedException
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at org.springframework.boot.loader.LaunchedURLClassLoader.doLoadClass(LaunchedURLClassLoader.java:178)
      at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:142)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      ... 5 more
  </code></pre>
  
  <p>JAVA_HOME is pointing to JDK as it should, and this is my pom</p>
  
  <pre><code>&lt;properties&gt;
      &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;activejpa.version&gt;0.2.5-SNAPSHOT&lt;/activejpa.version&gt;
      &lt;embedded.mongo.version&gt;1.50.3&lt;/embedded.mongo.version&gt;
  &lt;/properties&gt;
  
  &lt;parent&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
      &lt;version&gt;1.3.3.RELEASE&lt;/version&gt;
  &lt;/parent&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-mail&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-actuator&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.guava&lt;/groupId&gt;
          &lt;artifactId&gt;guava&lt;/artifactId&gt;
          &lt;version&gt;19.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.fasterxml.jackson.datatype&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-datatype-jsr310&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.activejpa&lt;/groupId&gt;
          &lt;artifactId&gt;activejpa-core&lt;/artifactId&gt;
          &lt;version&gt;${activejpa.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;postgresql&lt;/groupId&gt;
          &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
          &lt;version&gt;9.1-901-1.jdbc4&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-java8&lt;/artifactId&gt;
          &lt;version&gt;5.0.0.Final&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-ehcache&lt;/artifactId&gt;
          &lt;version&gt;4.3.7.Final&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;!-- MongoDB --&gt;
      &lt;!-- dependency&gt; &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt; &lt;artifactId&gt;spring-boot-starter-data-mongodb&lt;/artifactId&gt; 
          &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;de.flapdoodle.embed&lt;/groupId&gt; &lt;artifactId&gt;de.flapdoodle.embed.mongo&lt;/artifactId&gt; 
          &lt;version&gt;${embedded.mongo.version}&lt;/version&gt; &lt;/dependency --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.mongodb.morphia&lt;/groupId&gt;
          &lt;artifactId&gt;morphia&lt;/artifactId&gt;
          &lt;!-- See https://github.com/mongodb/morphia/releases for the latest version --&gt;
          &lt;version&gt;1.1.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;!-- THYMELEAF --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.thymeleaf&lt;/groupId&gt;
          &lt;artifactId&gt;thymeleaf&lt;/artifactId&gt;
          &lt;version&gt;${thymeleaf.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.thymeleaf&lt;/groupId&gt;
          &lt;artifactId&gt;thymeleaf-spring3&lt;/artifactId&gt;
          &lt;version&gt;${thymeleaf.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;nz.net.ultraq.thymeleaf&lt;/groupId&gt;
          &lt;artifactId&gt;thymeleaf-layout-dialect&lt;/artifactId&gt;
          &lt;version&gt;1.2.1&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;repositories&gt;
      &lt;repository&gt;
          &lt;id&gt;activejpa-mvn-repo&lt;/id&gt;
          &lt;url&gt;https://raw.github.com/juanignacionogueira/activejpa/mvn-repo/snapshots/&lt;/url&gt;
          &lt;snapshots&gt;
              &lt;enabled&gt;true&lt;/enabled&gt;
              &lt;updatePolicy&gt;always&lt;/updatePolicy&gt;
          &lt;/snapshots&gt;
      &lt;/repository&gt;
  
      &lt;repository&gt;
          &lt;id&gt;spring-releases&lt;/id&gt;
          &lt;url&gt;https://repo.spring.io/libs-release&lt;/url&gt;
      &lt;/repository&gt;
  &lt;/repositories&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;repackage&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;classifier&gt;spring-boot&lt;/classifier&gt;
                          &lt;mainClass&gt;com.rinlit.RinconLiterarioApplication&lt;/mainClass&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-failsafe-plugin&lt;/artifactId&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;integration-test&lt;/goal&gt;
                          &lt;goal&gt;verify&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  
  &lt;pluginRepositories&gt;
      &lt;pluginRepository&gt;
          &lt;id&gt;spring-releases&lt;/id&gt;
          &lt;url&gt;https://repo.spring.io/libs-release&lt;/url&gt;
      &lt;/pluginRepository&gt;
  &lt;/pluginRepositories&gt;
  </code></pre>
  
  <p>Any Idea of how should I run it without mvn? what am I doing bad?</p>