Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debian, openjdk, javax.annotation.Generated cannot find symbol #4498

Closed
poiuty opened this issue Jul 1, 2022 · 2 comments
Closed

Debian, openjdk, javax.annotation.Generated cannot find symbol #4498

poiuty opened this issue Jul 1, 2022 · 2 comments
Labels
topic: Build compile error, jitpack

Comments

@poiuty
Copy link

poiuty commented Jul 1, 2022

1. What did you do?

Try install java-tron on Debian 11.

Install java.

apt-get install openjdk-11-jdk-headless openjdk-11-jre-headless 

Set java-11-openjdk-amd64

# update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                         Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-17-openjdk-amd64/bin/java   1711      auto mode
* 1            /usr/lib/jvm/java-11-openjdk-amd64/bin/java   1111      manual mode
  2            /usr/lib/jvm/java-17-openjdk-amd64/bin/java   1711      manual mode

Download and build.

git clone https://github.com/tronprotocol/java-tron.git
cd java-tron
git checkout -t origin/master
./gradlew clean build -x test

2. What did you expect to see?

BUILD SUCCESSFUL

3. What did you see instead?

./gradlew clean build -x test
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details

> Task :protocol:compileJava FAILED
/home/tron/java-tron/protocol/src/main/java/org/tron/api/NetworkGrpc.java:23: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
/home/tron/java-tron/protocol/src/main/java/org/tron/api/WalletExtensionGrpc.java:20: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
/home/tron/java-tron/protocol/src/main/java/org/tron/api/MonitorGrpc.java:20: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
/home/tron/java-tron/protocol/src/main/java/org/tron/api/WalletGrpc.java:20: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
/home/tron/java-tron/protocol/src/main/java/org/tron/api/DatabaseGrpc.java:23: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
/home/tron/java-tron/protocol/src/main/java/org/tron/api/WalletSolidityGrpc.java:20: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
/home/tron/java-tron/protocol/src/main/java/org/tron/api/TronZksnarkGrpc.java:20: error: cannot find symbol
@javax.annotation.Generated(
                 ^
  symbol:   class Generated
  location: package javax.annotation
7 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':protocol:compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 20s
25 actionable tasks: 14 executed, 11 up-to-date

4. Fix it.

Found a solution. Add the javax annotation dependency into build.gradle

    dependencies {
        compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
        ...
        implementation 'javax.annotation:javax.annotation-api:1.3.2' 
     }

Try build.

./gradlew clean build -x test

BUILD SUCCESSFUL in 1m 45s
75 actionable tasks: 69 executed, 6 up-to-date
@poiuty poiuty changed the title Debian 11, openjdk 11, javax.annotation.Generated cannot find symbol Debian, openjdk, javax.annotation.Generated cannot find symbol Jul 1, 2022
@halibobo1205
Copy link
Contributor

Java-tron can only run on jdk 1.8, arch x86 .

@ethan1844 ethan1844 added the topic: Build compile error, jitpack label Jul 4, 2022
@ethan1844
Copy link
Contributor

Thanks for your contribution to java-tron, this issue will be closed as no update for a long time.

Please feel free to re-open it if you still see the issue, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: Build compile error, jitpack
Projects
None yet
Development

No branches or pull requests

5 participants
@poiuty @halibobo1205 @ethan1844 and others