Error while compiling thrift generated classes with Java 1.5

ata
`Platform`: Windows 7, MinGW, MSYS, Java 1.5

I have thrift 0.9.1 compiler (prebuilt for windows) and source. I use Ant to build java library. I create one thrift idl and compile it with the compiler. No problem in generating code files. I add these files in my project, and that add slf4j (downloaded from their site) and libthrift. Most of the errors that I have previously (imports etc) are gone except for errors related to overriding methods. So basically it complains like:

The method clear() of type Server must override a superclass method

and similarly for compareTo, write, read etc. In short it complains about all methods that are overridden. This is all thrift compiler generated code and I haven't changed anything.

Is there any incompatibility? I cannot really find any mention of that. I have tried removing and then adding the libraries, I have also tried cleaning, refreshing, validating the project but the errors are still there.

I have also tried to compile the code (thrift code) but MinGW is also a huge headache. It cannot find configure even though I have installed it. And if I run the msys console, it is able to configure but cannot make complaining about inttypes.h not present (which is not in msys include directory but is present in MinGW include directory.).

Any suggestion would be appreciated.

BCG

Are you using Java 5? With Java 5 @Override doesn't search for methods on interfaces, only on superclasses.

If you are using a Java 5 compiler trying using a more recent javac (preferably 7 or 8) and see of that works.

EDIT:

Not sure if this is in your version of Thrift, but in mine it looks like there is a flag called java5 that you an specify when generating code to specify that you want the generated code to be Java 5 compliant

java (Java):
    beans:           Members will be private, and setter methods will return void.
    private-members: Members will be private, but setter methods will return 'this' like usual.
    nocamel:         Do not use CamelCase field accessors with beans.
    fullcamel:       Convert underscored_accessor_or_service_names to camelCase.
    android:         Generated structures are Parcelable.
    android_legacy:  Do not use java.io.IOException(throwable) (available for Android 2.3 and above).
    java5:           Generate Java 1.5 compliant code (includes android_legacy flag).
    reuse-objects:   Data objects will not be allocated, but existing instances will be used (read and write).
    sorted_containers:
                     Use TreeSet/TreeMap instead of HashSet/HashMap as a implementation of set/map.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Android - SQLite - syntax error (code 1): , while compiling: CREATE TABLE

분류에서Dev

Error while compiling a file in ubuntu

분류에서Dev

Android SQLiteException: near ",": syntax error: , while compiling INSERT

분류에서Dev

How to overcome this error while compiling RT2870 driver?

분류에서Dev

Opencv-Error while compiling libccv(static library)

분류에서Dev

SQLiteException : no such table : trainingsplan (code 1) while compiling : select statment

분류에서Dev

Kotlin / Android : android.database.sqlite.SQLiteException : no such table : Table_xx (code 1 SQLITE_ERROR) :, while compiling : select * from Table_xx

분류에서Dev

Simple JAVA program error , using multiple classes

분류에서Dev

Cygwin gcc compiling error

분류에서Dev

Apache Thrift 암호화-Java

분류에서Dev

Implicit Compiling in java

분류에서Dev

Error while executing linux command using Java

분류에서Dev

원인 : android.database.sqlite.SQLiteException : no such column : date (code 1) :, while compiling : SELECT id, name, description, date FROM tasks

분류에서Dev

Error compiling Oracle stored procedure

분류에서Dev

Octave error: no default value for argument 1 while calling function

분류에서Dev

Error while installing Apache; error is "E: Sub-process /usr/bin/dpkg returned an error code (1)"

분류에서Dev

Error while creating a projrct with djangocms -p test1 test1 with exit status 1?

분류에서Dev

Cross Compiling for Arm armv5tejl

분류에서Dev

Apache Thrift Java 최소 요구 사항

분류에서Dev

error "None of the policy alternatives can be satisfied" with cxf wsdl2java generated webservice

분류에서Dev

Difference between command line tool compiling and IDE compiling Java

분류에서Dev

Error while adding data to index in java embedded elasticsearch related to PostingFormats

분류에서Dev

Update query in SQL, syntax error while running on java

분류에서Dev

Java home path error while configuring hadoop in windows 7

분류에서Dev

error compiling openCTM in x64

분류에서Dev

Error compiling JSPs in Apache Tomcat 8.0.12

분류에서Dev

Parse Error compiling Octave script on Ubuntu

분류에서Dev

Error compiling source code, possibly related to cpp

분류에서Dev

Error with compiling RInside examples under Windows

Related 관련 기사

  1. 1

    Android - SQLite - syntax error (code 1): , while compiling: CREATE TABLE

  2. 2

    Error while compiling a file in ubuntu

  3. 3

    Android SQLiteException: near ",": syntax error: , while compiling INSERT

  4. 4

    How to overcome this error while compiling RT2870 driver?

  5. 5

    Opencv-Error while compiling libccv(static library)

  6. 6

    SQLiteException : no such table : trainingsplan (code 1) while compiling : select statment

  7. 7

    Kotlin / Android : android.database.sqlite.SQLiteException : no such table : Table_xx (code 1 SQLITE_ERROR) :, while compiling : select * from Table_xx

  8. 8

    Simple JAVA program error , using multiple classes

  9. 9

    Cygwin gcc compiling error

  10. 10

    Apache Thrift 암호화-Java

  11. 11

    Implicit Compiling in java

  12. 12

    Error while executing linux command using Java

  13. 13

    원인 : android.database.sqlite.SQLiteException : no such column : date (code 1) :, while compiling : SELECT id, name, description, date FROM tasks

  14. 14

    Error compiling Oracle stored procedure

  15. 15

    Octave error: no default value for argument 1 while calling function

  16. 16

    Error while installing Apache; error is "E: Sub-process /usr/bin/dpkg returned an error code (1)"

  17. 17

    Error while creating a projrct with djangocms -p test1 test1 with exit status 1?

  18. 18

    Cross Compiling for Arm armv5tejl

  19. 19

    Apache Thrift Java 최소 요구 사항

  20. 20

    error "None of the policy alternatives can be satisfied" with cxf wsdl2java generated webservice

  21. 21

    Difference between command line tool compiling and IDE compiling Java

  22. 22

    Error while adding data to index in java embedded elasticsearch related to PostingFormats

  23. 23

    Update query in SQL, syntax error while running on java

  24. 24

    Java home path error while configuring hadoop in windows 7

  25. 25

    error compiling openCTM in x64

  26. 26

    Error compiling JSPs in Apache Tomcat 8.0.12

  27. 27

    Parse Error compiling Octave script on Ubuntu

  28. 28

    Error compiling source code, possibly related to cpp

  29. 29

    Error with compiling RInside examples under Windows

뜨겁다태그

보관