因为网络上关于这个JXTA-C源码编译的文章较少,所以我在此首先写一份编译的完整过程,以供网友们参考。
JXTA-C源码所在地址:http://download.java.net/jxta/
leekwen@ubuntu:~$ cat /etc/issue
Ubuntu 12.04.4 LTS \n \l
leekwen@ubuntu:~$ file /bin/ls
/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x83531f308f1fa18221be53eaf399303400c14638, stripped
leekwen@ubuntu:~$ sudo apt-get install -y libtool automake autoconf libxml2 libxml2-dev libapr1-dev libaprutil1-dev
[sudo] password for leekwen:
Reading package lists... Done
Building dependency tree
Reading state information... Done
leekwen@ubuntu:~$ wget -c http://download.java.net/jxta/jxta-c/2.5.2/jxta-c-2.5.2.tar.bz2
leekwen@ubuntu:~$ apr-config --includedir
/usr/include/apr-1.0
leekwen@ubuntu:~$ apu-config --includedir
/usr/include/apr-1.0
leekwen@ubuntu:~$ grep APU_HAVE_DB /usr/include/apr-1.0/apu.h
#define APU_HAVE_DB 1
#if APU_HAVE_DB
#define APU_HAVE_DB_VERSION 5
leekwen@ubuntu:~$ tar jxvf jxta-c-2.5.2.tar.bz2
leekwen@ubuntu:~$ cd jxta-c-2.5.2
leekwen@ubuntu:~/jxta-c-2.5.2$ ./configure --without-apr --with-dbm=db
JXTA has been configured with the following options:
Debug enabled : no
Compression enabled : yes
Decompression enabled : yes
Mono support enabled : no
libxml2 Path : /usr
APR Path :
APU Path :
sqlite Path : /usr
openssl Path : /usr
Thread pool availability: jxta/jpr
leekwen@ubuntu:~/jxta-c-2.5.2$ make -j 2
结果如下:
creating whisp
make[2]: Leaving directory `/home/leekwen/jxta-c-2.5.2/tutorials'
make[2]: Entering directory `/home/leekwen/jxta-c-2.5.2'
make[2]: Leaving directory `/home/leekwen/jxta-c-2.5.2'
make[1]: Leaving directory `/home/leekwen/jxta-c-2.5.2'
leekwen@ubuntu:~/jxta-c-2.5.2$ cd shell/
leekwen@ubuntu:~/jxta-c-2.5.2/shell$ ./jxtaShell
Starting logger with selector : *.warning-fatal
[JXTA]-warning-[05/19 00:34:30:863264][TID: 0xb70ba700] - [jxta_tta.c:386] Deprecated API jxta_TCPTransportAdvertisement_set_InterfaceAddress called.
[CM]-error-[05/19 00:34:30:930237][TID: 0xb70ba700] - Failed to load driver file apr_dbd_sqlite3.so
[CM]-error-[05/19 00:34:30:931425][TID: 0xb70ba700] - db_id: 1 -- error creating tables db return 20019
[CM]-error-[05/19 00:34:30:932410][TID: 0xb70ba700] - Failed to open dbd database: .cm/jxta-NetGroup.sqdb with error 20019
[CM]-error-[05/19 00:34:30:933554][TID: 0xb70ba700] - Error processing address spaces -- 120007
Segmentation fault (core dumped)
leekwen@ubuntu:~/jxta-c-2.5.2/shell$ sudo apt-get install libaprutil1-dbd-sqlite3
leekwen@ubuntu:~/jxta-c-2.5.2/shell$ ./jxtaShell
Starting logger with selector : *.warning-fatal
[JXTA]-warning-[05/19 00:36:40:275230][TID: 0xb70e5700] - [jxta_tta.c:386] Deprecated API jxta_TCPTransportAdvertisement_set_InterfaceAddress called.
[PV]-warning-[05/19 00:36:41:260503][TID: 0xb70e5700] - [jxta_peerview.c:711] Could not find the endpoint service params
[JXTA]-warning-[05/19 00:36:41:261929][TID: 0xb70e5700] - [jxta_endpoint_service.c:1416] Deprecated API jxta_endpoint_service_add_listener called.
[JXTA]-warning-[05/19 00:36:41:309777][TID: 0xb70e5700] - [jxta_endpoint_service.c:1416] Deprecated API jxta_endpoint_service_add_listener called.
=========================================================
========= Welcome to the JXTA-C Shell Version 2.5.2 ======
=========================================================
The JXTA Shell provides an interactive environment to the JXTA
platform. The Shell provides basic commands to discover peers and
peergroups, to join and resign from peergroups, to create pipes
between peers, and to send pipe messages. The Shell provides environment
variables that permit binding symbolic names to Jxta platform objects.
Environment variables allow Shell commands to exchange data between
themselves. The shell command 'env' displays all defined environment
variables in the current Shell session.
A 'man' command is available to list the commands available.
To exit the Shell, use the 'exit' command.
JXTA>[RELAY]-warning-[05/19 00:36:41:333294][TID: 0xb579eb40] - Not seeded with any valid relay addresses
JXTA>man
For which command do you want help?
TestApplication
env
cat
whoami
kdb
peers
talk
join
groups
search
leave
rdvstatus
rdvcontrol
publish
JXTA>exit
Exiting Jxta shell
[HTTP_TRANSPORT]-warning-[05/19 00:36:52:358205][TID: 0xb70e5700] - don't know how to stop yet.
[JXTA]-warning-[05/19 00:36:53:441809][TID: 0xb70e5700] - [jxta_endpoint_service.c:1443] Deprecated API jxta_endpoint_service_remove_listener called.
[JXTA]-warning-[05/19 00:36:53:442622][TID: 0xb70e5700] - [jxta_endpoint_service.c:1443] Deprecated API jxta_endpoint_service_remove_listener called.
[SERVICE]-warning-[05/19 00:36:53:443634][TID: 0xb70e5700] - Jxta_service_init is not called??
[SERVICE]-warning-[05/19 00:36:53:443673][TID: 0xb70e5700] - Jxta_service_init is not called??
[SERVICE]-warning-[05/19 00:36:53:443752][TID: 0xb70e5700] - Jxta_service_init is not called??
[SERVICE]-warning-[05/19 00:36:53:443767][TID: 0xb70e5700] - Jxta_service_init is not called??