Ended up being an issue with java-lite protos in eclipse, amended to used
full java 3.18.0 to resolve. My clean eclipse build notes,
Install JDK 11
Set JAVA_HOME = D:\Java\jdk-11.0.12
Add %JAVA_HOME%\bin to PATH
Install Gradle 4.10.2
D:\Gradle\gradle-4.10.2
Add Gradle bin to PATH
D:\Gradle\gradle-4.10.2\bin
Clone latest bitcoinj release
git clone -b release-0.16 https://github.com/bitcoinj/bitcoinj.git
Ammend core\build.gradle to protobuf-java-3.18.0 (not java-lite) and
comment out //option "lite"
(https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-java/)
api 'com.google.protobuf:protobuf-java:3.18.0'
...
protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.18.0'
}
generateProtoTasks {
all().each { task ->
task.builtins {
java {
//option "lite"
}
}
}
}
Build and create eclipse config in bitcoinj folder
gradle init
gradle clean assemble
gradle eclipse
Install eclipse-java-2020-06-R-win32-x86_64
File > Import > General > Existing Projects into Workspace >
<bitcoinj folder>
Change file encoding to UTF8
/bitcoinj-core/src/test/java/org/bitcoinj/utils/BtcFormatTest.java
Run
/bitcoinj-tools/src/main/java/org/bitcoinj/tools/WatchMempool.java
On Tuesday, January 4, 2022 at 1:26:29 PM UTC-5 Geoffrey Schulman wrote:
> Found this thread with same issue
>
> https://osgeo-org.atlassian.net/browse/GEOT-5910
>
> I will try downgrade to protobuf 3.4
>
> On Tuesday, January 4, 2022 at 1:23:35 PM UTC-5 Geoffrey Schulman wrote:
>
>> Gradle builds just fine, but eclipse complaining about all casts from
>> GeneratedMessageLite.Builder()
>>
>> public static Builder newBuilder() {
>> return (Builder) DEFAULT_INSTANCE.createBuilder();
>> }
>>
>> Cannot cast from
>> GeneratedMessageLite.Builder<GeneratedMessageLite<GeneratedMessageLite<MessageType,GeneratedMessageLite.Builder<MessageType,BuilderType>>,GeneratedMessageLite.Builder<GeneratedMessageLite<MessageType,BuilderType>,BuilderType>>,GeneratedMessageLite.Builder<GeneratedMessageLite<GeneratedMessageLite<MessageType,BuilderType>,BuilderType>,BuilderType>>
>>
>> to PeerSeedProtos.PeerSeeds.Builder
>>
>> On Monday, January 3, 2022 at 8:16:25 PM UTC-5 Andreas Schildbach wrote:
>>
>>> If you use Gradle for building, it should use the correct versions
>>> automatically.
>>>
>>> On current master, we use Protobuf 3.18.0.
>>>
>>>
>>> On 04/01/2022 01.18, Geoffrey Schulman wrote:
>>> > Curious which version of protobuf I should be building with as 3.19.1
>>> > java source has come compilation errors...
>>> >
>>> > Thank you
>>> >
>>> > Geoff Schulman
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> > Groups "bitcoinj" group.
>>> > To unsubscribe from this group and stop receiving emails from it, send
>>> > an email to [email protected]
>>> > <mailto:[email protected]>.
>>> > To view this discussion on the web visit
>>> >
>>> https://groups.google.com/d/msgid/bitcoinj/34c776d4-b007-47d6-9190-bf05917e8a5dn%40googlegroups.com
>>>
>>> > <
>>> https://groups.google.com/d/msgid/bitcoinj/34c776d4-b007-47d6-9190-bf05917e8a5dn%40googlegroups.com?utm_medium=email&utm_source=footer>.
>>>
>>>
>>>
>>
--
You received this message because you are subscribed to the Google Groups
"bitcoinj" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/bitcoinj/01891b2c-40d9-4fb7-8e05-be30b1feb8dfn%40googlegroups.com.