terrymanu commented on issue #36993:
URL:
https://github.com/apache/shardingsphere/issues/36993#issuecomment-3479213809
Problem Analysis
Based on the error information you provided, this is a Maven compilation
failure. The core errors are:
[ERROR] Package org.apache.shardingsphere.distsql.parser.autogen does not
exist
[ERROR] Symbol not found: class KernelDistSQLStatementLexer
[ERROR] Symbol not found: class KernelDistSQLStatementParser
Root Cause Analysis
The root cause of this problem is that the ANTLR4 code generation step did
not execute correctly. The KernelDistSQLStatementLexer and
KernelDistSQLStatementParser classes should be automatically generated by the
ANTLR4
plugin from .g4 grammar files, but the generation failed for some reason.
Solutions
Solution 1: Force ANTLR Code Generation (Recommended)
cd /path/to/shardingsphere/parser/distsql/engine
mvn antlr4:antlr4
mvn compile
Solution 2: Clean and Rebuild
cd /path/to/shardingsphere
mvn clean install -DskipTests
Solution 3: Use Correct JDK Version
ShardingSphere requires JDK 11+ for building:
# Check Java version
java -version
# If version is lower than 11, please upgrade to JDK 11+
export JAVA_HOME=/path/to/jdk11
mvn install -DskipTests
Solution 4: Generate Sources Manually
cd /path/to/shardingsphere/parser/distsql/engine
mvn clean
mvn generate-sources
mvn compile
Information Needed
If none of the above solutions work, please provide the following
information for further diagnosis:
1. Java Version:
java -version
2. Maven Version:
mvn -version
3. Detailed Build Log:
mvn compile -X > build.log 2>&1
3. Then share the key parts of the build.log file
4. Environment Information:
- Operating system
- Whether it's the latest code cloned from GitHub
- Whether network connection is working properly
Prevention Measures
1. Ensure using JDK 11+ for building
2. Use complete build command mvn clean install instead of partial builds
3. Ensure proper network connection so Maven can download all dependencies
4. Build in a clean environment to avoid previous build cache issues
This problem can usually be solved by forcing the ANTLR code generation
step. Please try Solution 1 first, and if that doesn't work, try the other
solutions in order.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]