Author

Topic: Testing bitcoinj on Ubuntu (Read 3750 times)

full member
Activity: 125
Merit: 100
May 04, 2011, 06:10:57 PM
#6
Try running it like this:
Code:
java -classpath .:../lib/* com.google.bitcoin.examples.PingService

In the mean time file an issue report at the bitcoinj project so the build can get fixed to include the logger.
full member
Activity: 136
Merit: 100
May 04, 2011, 04:58:29 PM
#5
Now, I am getting a different error. Following the instructions in the README after completing the build:

Code:
$ cd out
$ java com.google.bitcoin.examples.PingService
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at com.google.bitcoin.core.Block.(Unknown Source)
at com.google.bitcoin.core.NetworkParameters.createGenesis(Unknown Source)
at com.google.bitcoin.core.NetworkParameters.prodNet(Unknown Source)
at com.google.bitcoin.examples.PingService.main(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 4 more
full member
Activity: 136
Merit: 100
May 04, 2011, 10:28:55 AM
#4
Whoops, fixed. Updating to svn head should resolve things. You don't need to install it from apt - the source tree is self contained.

The best place to ask questions about bitcoinj is the mailing list. Did you know there was one? Maybe I need to make it more visible.

Thanks. It's working now.
legendary
Activity: 1526
Merit: 1134
May 04, 2011, 06:58:03 AM
#3
Whoops, fixed. Updating to svn head should resolve things. You don't need to install it from apt - the source tree is self contained.

The best place to ask questions about bitcoinj is the mailing list. Did you know there was one? Maybe I need to make it more visible.
full member
Activity: 125
Merit: 100
May 03, 2011, 05:38:39 PM
#2
Open build.xml and change this:

to this:

       
       

That should probably do it.
slf4j is a recent addition and just didn't get added to the build script.
full member
Activity: 136
Merit: 100
May 03, 2011, 04:19:40 PM
#1
I am trying to test bitcoinj on Ubuntu, but I am having some trouble. I am not experienced with Java delvelopment, so maybe I am missing something obvious

Here are the steps I follow to build bitcoinj
Code:
sudo apt-get install libslf4j-java
svn checkout http://bitcoinj.googlecode.com/svn/trunk/ bitcoinj
cd bitcoinj
ant

The last command results in the following error:

Code:
Buildfile: ~/Desktop/Dev/bitcoinj/build.xml

init:

compile:
    [javac] Compiling 814 source files to ~/Desktop/Dev/bitcoinj/out
    [javac] ~/Desktop/Dev/bitcoinj/src/com/google/bitcoin/core/Block.java:25: package org.slf4j does not exist
    [javac] import org.slf4j.Logger;
    [javac]                 ^
    [javac] ~/Desktop/Dev/bitcoinj/src/com/google/bitcoin/core/Block.java:26: package org.slf4j does not exist
    [javac] import org.slf4j.LoggerFactory;
    [javac]                 ^

How can I get it to find the slf4j package?

Thanks.
Jump to: