0

I am trying to use web3j in java, but when i try to make a web3j object it gives an error

         Web3j web3j = Web3j.build(new HttpService());
Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/TreeNode

i think it's because port forwarding is not enabled, am i right ?

EAOE
  • 65
  • 6

1 Answers1

0

The error you are encountering is not related to port, but to a missing dependency:

Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/TreeNode

This means that you are lacking the class com.fasterxml.jackson.core.TreeNode in your class path or module path.

I don't know web3j but their site seems to references Maven or Gradle. You should try with those build tool since they will provide you the dependencies.

NoDataFound
  • 11,381
  • 33
  • 59
  • i was facing issues downloading using gradle and maven so i downloaded everything manually all 11 libraries, would that still result in missing libraries ? – EAOE Jan 31 '21 at 11:29
  • I can't tell for missing libraries: I use maven because that's what a dependency manager is for :) – NoDataFound Jan 31 '21 at 18:02