HomeAdvisor / Kafdrop

Kafka UI and Monitoring Tool
Apache License 2.0
398 stars 163 forks source link

Build error os OSX: JmxUtils.java:[23,21] error: cannot find symbol #17

Open raarts opened 6 years ago

raarts commented 6 years ago

Java amateur alert!

raarts$ mvn clean package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building kafdrop 2.2.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ kafdrop ---
[INFO]
[INFO] --- maven-resources-plugin:2.7:copy-resources (prepare-dockerfile) @ kafdrop ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ kafdrop ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 11 resources
[INFO] Copying 13 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ kafdrop ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 37 source files to /Users/raarts/work/nv/rapi-elixir/Kafdrop/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/raarts/work/nv/rapi-elixir/Kafdrop/src/main/java/com/homeadvisor/kafdrop/util/JmxUtils.java:[23,21] error: cannot find symbol
[ERROR]  package sun.management
/Users/raarts/work/nv/rapi-elixir/Kafdrop/src/main/java/com/homeadvisor/kafdrop/util/JmxUtils.java:[36,46] error: cannot find symbol
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.757 s
[INFO] Finished at: 2017-11-28T14:31:00+01:00
[INFO] Final Memory: 27M/91M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project kafdrop: Compilation failure: Compilation failure:
[ERROR] /Users/raarts/work/nv/rapi-elixir/Kafdrop/src/main/java/com/homeadvisor/kafdrop/util/JmxUtils.java:[23,21] error: cannot find symbol
[ERROR]  package sun.management
[ERROR] /Users/raarts/work/nv/rapi-elixir/Kafdrop/src/main/java/com/homeadvisor/kafdrop/util/JmxUtils.java:[36,46] error: cannot find symbol
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
dhayha commented 6 years ago

What version of Java are you using?

raarts commented 6 years ago

$ java --version java 9.0.1 Java(TM) SE Runtime Environment (build 9.0.1+11) Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)

cforce commented 5 years ago

java version "11.0.1" 2018-10-16 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)

dhayha commented 5 years ago

The sun.management package has gone away with Java 9 and above. I haven't (yet) found an appropriate replacement to using he sun.management.Agent class to get the fully resolved JMX properties.

cforce commented 5 years ago

I would have an look into https://jolokia.org/ https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-jmx.html#production-ready-jolokia

satyajeetcmm commented 5 years ago

Any update on this.

Casa-Cloud commented 5 years ago

Hello, Any update on this, I am getting the same error on my window 10 machine

JAVA version:- java -version java version "1.8.0_161" Java(TM) SE Runtime Environment (build 1.8.0_161-b12) Java HotSpot(TM) Client VM (build 25.161-b12, mixed mode)

Error:- $ mvn clean package ... [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project kafdrop: Compilation failure: Compilation failure: [ERROR] \Users\AlokAdhao\Desktop\IBM\kafdrop\Kafdrop\src\main\java\com\homeadvisor\kafdrop\util\JmxUtils.java:[23,21] error: cannot find symbol [ERROR] \Users\AlokAdhao\Desktop\IBM\kafdrop\Kafdrop\src\main\java\com\homeadvisor\kafdrop\util\JmxUtils.java:[36,46] error: cannot find symbol

ekoutanov commented 5 years ago

You won't be able to utilise sun.management unless you permit it explicitly using the --add-exports JVM option. This is unlikely going to get fixed in Kafdrop 2.x, as there is no real development taking place. Consider updating to the next major version – Kafdrop 3.