构建ubuntu下的JXTA-C开发环境

本文详细记录了JXTA-C 2.5.2版本源码的编译全过程,包括所需环境配置、依赖库安装、编译过程中可能出现的问题及解决办法等关键信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

概述:

因为网络上关于这个JXTA-C源码编译文章较少,所以在此首先写一份编译完整过程,以供网友们参考。

JXTA-C源码所在地址:http://download.java.net/jxta/ 


1、操作系统环境

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

2、安装编译JXTA-C源码所需的基本库

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

3、下载JXTA-C-2.5.2.tar.bz2源码包

leekwen@ubuntu:~$ wget -c http://download.java.net/jxta/jxta-c/2.5.2/jxta-c-2.5.2.tar.bz2


4、测试APR及APU的环境是否安装OK?

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

5、配置JXTA-C源码

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

6、编译JXTA-C源码


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'


7、运行jxtashell

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)

如果运行jxtashell出现的错误如上的话,请安装JXTASHELL运行所依赖的连接库sqlite的库文件:


leekwen@ubuntu:~/jxta-c-2.5.2/shell$ sudo apt-get install libaprutil1-dbd-sqlite3

安装完毕后,再次执行jxtashell:


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??

到此JXTA-C的编译算是完成了!! # 转载请注明出处 # leekwen

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Leekwen

您的鼓励,是我坚持更新的动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值