Home > Enterprise >  I keep getting the error Could not find artifact sun.jdk:jconsole:jar:jdk at specified path /usr/lib
I keep getting the error Could not find artifact sun.jdk:jconsole:jar:jdk at specified path /usr/lib

Time:11-13

I'm trying to get the keycloak quick start applications connected to keycloak and learn how the authorization mechanism works.

I'm following this guide: https://www.keycloak.org/docs/latest/authorization_services/#_getting_started_overview

I've done these steps:

  1. Installed Ubuntu 20.
  2. sudo apt install openjdk-8-jre-headless
  3. sudo apt install openjdk-8-jdk-headless
  4. Downloaded and extracted Keycloak-15 on my system.
  5. Downloaded and extracted Wildfly-10 on my system.
  6. ./bin/standalone.sh -Djboss.socket.binding.port-offset=100 for Keycloak so its running at http://localhost:8180
  7. Configured Keycloak adapter for Wildfly instance.
  8. ./bin/standalone.sh for Wildfly so its running at http://localhost:8080
  9. Copied keycloak.json file obtained from keycloack server to keycloak-quickstarts/app-authz-jee-vanilla/config
  10. mvn clean package wildfly:deploy in app-authz-jee-vanilla directory.

Following the guide I mentioned, I'm stuck in the Build, Deploy, and Test Your Application section. I try to build the app-authz-jee-vanilla app but I keep getting this error:

[ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.2.2.Final:deploy (default-cli) on project keycloak-app-authz-jee-vanilla: Execution default-cli of goal org.wildfly.plugins:wildfly-maven-plugin:1.2.2.Final:deploy failed: Plugin org.wildfly.plugins:wildfly-maven-plugin:1.2.2.Final or one of its dependencies could not be resolved: Could not find artifact sun.jdk:jconsole:jar:jdk at specified path /usr/lib/jvm/java-8-openjdk-amd64/jre/../lib/jconsole.jar

Looks like maven cannot deal with some dependency. But I dont know how to solve it!

I would be thankful if anybody can solve this problem.

CodePudding user response:

So finally I've managed to solve the problem. I did some steps according to searching and comments. The steps were:

  1. First of all, I figured out that when I install JDK there is no need to install JRE! So I've uninstalled JRE.
  2. I've changed to wildfly 11.
  3. I've run this command: mvn clean org.wildfly.plugins:wildfly-maven-plugin:2.1.0.Final:deploy

And VOILA! Build is successful and I now have access to the app in my browser.

P. S. Actually I'm not sure if the main problem was with existance of JRE and JDK on my machine at the same time because I didn't test it with JRE installed.

  • Related