Search code examples
javamavenmaven-3rocketmq

RocketMQ nameserver start error -- Could not find or load main class


I was trying to install RocketMQ from scratch following the official guide, I used jdk 1.8.0_121 and maven 3.5.0.

However, after the step mvn -Prelease-all -DskipTests clean install -U, there was no directory distribution generated, so the cd distribution/target/apache-rocketmq wouldn't succeed.

Then I tried to directly start the nameserver by typing sh bin/mqnamesrv, and it gave me the following error.

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=320m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: Using the DefNew young collector with the CMS collector is deprecated and will likely be removed in a future release
Java HotSpot(TM) 64-Bit Server VM warning: UseCMSCompactAtFullCollection is deprecated and will likely be removed in a future release.
Error: Could not find or load main class org.apache.rocketmq.namesrv.NamesrvStartup

I had thought it might be the problem of my CLASSPATH environment variable, but it still didn't work even if I set it. Below is my configuration

export JAVA_HOME=$HOME/src/jdk1.8.0_121
export PATH=$PATH:$JAVA_HOME/bin
export MAVEN_HOME=$HOME/src/apache-maven-3.5.0
export PATH=$PATH:$MAVEN_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

Is there any update to the source code or some extra step that does not appear on the document yet, I wonder if I missed anything?


Solution

  • Sorry to bring you trouble, please git clone the newest source code in develop branch, and there is a independent module distribution.

    While please cd target/apache-rocketmq-all/ to run rocketmq if you are in master branch.