Error while running pjsip sample pjsua on android ndk - java

I successfully performed ./configure-android and make dep && make install commands using pjsip and I successfully install SWIG too.
But I am getting the following error while running the sample pjsua.
/Users/Downloads/swig-2.0.11 -c++ -o jni/pjsua_wrap.cpp -package org.pjsip.pjsua -outdir src/org/pjsip/pjsua -java jni/pjsua.i
make: execvp: /Users/Downloads/swig-2.0.11: Permission denied
make: *** [jni/pjsua_wrap.cpp] Error 127

Seems that MY_SWIG variable in pjsip-apps/src/pjsua/android/Android.mk is pointing to /Users/Downloads/swig-2.0.11 instead to swig binary file.
If you downloaded swig source to /Users/Downloads/swig-2.0.11 and you build it, binary file should be at: /Users/Downloads/swig-2.0.11/swig
Another problem you maybe find is that object files for project pjsua-app does not exists, this is because this is not done by default on the general build (more specifically, corresponding target is not included on all target at pjsip-apps/build/Makefile). To fix this just go to pjsip-apps/build and run:
make pjsua
This would create proper object files at: pjsip-apps/build/output/pjsua-arm-unknown-linux-androideabi/ (needed when building android sample)

Related

Alljoyn Cross compilation: Scons returns of non-existent variable ''alljoyn_jar''

Scons returns with an ERROR: scons: *** Return of non-existent variable ''alljoyn_jar''
the command is:
scons BINDINGS=java OS=openwrt CPU=openwrt VARIANT=debug BUILD_SERVICES_SAMPLES=off POLICYDB=on WS=off
scons: Reading SConscript files ...
Building bindings: java
Building services:
BULLSEYE_BIN not specified
Using OpenSSL crypto
GTEST_DIR not specified skipping common unit test build
BULLSEYE_BIN not specified
GTEST_DIR not specified skipping About Service unit test build
GTEST_DIR not specified skipping alljoyn_core unit test build
scons: *** Return of non-existent variable ''alljoyn_jar''
File "/home/pi/WORKING_DIRECTORY32/alljoyn-15.04.00-src/alljoyn_java/src/SConscript", line 48, in <module>
environment variable:
export CROSS_COMPILE_HOME=/opt/windriver/wrlinux/7.0-intel-quark/sysroots/quark-wrs-linux
export TARGET_PATH=$PATH
export TARGET_CC=gcc
export TARGET_CXX=g++
export TARGET_LINK=gcc
export TARGET_AR=ar
export TARGET_RANLIB=ranlib
export TARGET_CFLAGS="-I$CROSS_COMPILE_HOME/usr/lib/gcc/i586-windriverquark-linux/4.9.1/include -I$CROSS_COMPILE_HOME/usr/local/jdk1.7.0_79/include/"
export TARGET_CPPFLAGS=-I$CROSS_COMPILE_HOME/usr/lib/gcc/i586-windriverquark-linux/4.9.1/include
export TARGET_LDFLAGS=-L$CROSS_COMPILE_HOME/usr/lib
export TARGET_LINKFLAGS=$TARGET_LDFLAGS
export AJ_ROOT=$CROSS_COMPILE_HOME/compiled/alljoyn
export JAVA_HOME=$CROSS_COMPILE_HOME/usr/lib/jvm/java-7-openjdk/jre
Could you help me?
if i'm not wrong, you are trying to build AllJoyn on the RaspberryPI and the Pi is an ARM based CPU, so the first correction u need to make is
CPU=arm
secondly since you are trying to build in Java you need to cross compile
CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf-
for a more detailed procedure of extracting on the RaspberryPi Compiling on the RaspberryPi and you can also have a look the Allseen Alliance Wiki Page

SimGrid-3.13 Can't load classes

There are steps for building .jar file of SimGrid.
I downloaded archive from here.
Then I made following
cmake -DCMAKE_INSTALL_PREFIX=/home/Documents/simgrid -Denable_maintainer_mode=off -Denable_compile_optimizations=off -Denable_java=on -Denable_model-checking=off
make
make check
100% tests passed, 0 tests failed out of 586
ctest
100% tests passed, 0 tests failed out of 586
make install
There is simgrid.jar in SimGrid-3.13 folder.
But when I write code I can't load classes from this .jar file.
How can I fix it?
UPDATED
If I download ready simgrid.jar from thence, error occurs
Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/simgrid-java2166199247712718748/libsimgrid.so: libcgraph.so.6: cannot open shared object file: No such file or directory
Where I have to add libsimgrid-java.so, libsimgrid.so?
UPDATED2
After installing graphviz graphviz-dev. New error occurs
Invalid XML (XML input line 2, state 2): Bad declaration <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">.
If your are using a XML v3 file (check the version attribute in <platform>), please update it with tools/simgrid_update_xml.pl
[0.000000] /builds/workspace/SimGrid-Multi/build_mode/Debug/node/simgrid-ubuntu-trusty-64/build/SimGrid-3.13/src/surf/xml/surfxml_sax_cb.cpp:55: [surf_parse/ERROR] Parse error at (null):2: Parse error in /home/ken/IdeaProjects/Sim2Sim/src/main/java/LHCb/platform.xml
[0.000000] /builds/workspace/SimGrid-Multi/build_mode/Debug/node/simgrid-ubuntu-trusty-64/build/SimGrid-3.13/src/surf/xml/surfxml_sax_cb.cpp:57: [xbt/CRITICAL] Exiting now
As for the second update, you should read the error message that you copy-pasted:
If your are using a XML v3 file (check the version attribute in <platform>), please update it with tools/simgrid_update_xml.pl
Can you confirm that:
(1) the version attribute in the <platform> is 3
(2) running the tools/simgrid_update_xml.pl script on the platform fixes the problem?
I just checked the Debian package search page, in the second search box. I looked for /usr/lib/libcgraph.so.6 and it says that this library is in the package libcgraph6. So you have to apt-get install libcgraph6 to get it.

TCLBLEND FAILURE - Centos 6.4

I have been trying to use a home grown test tool and after doing an update to Centos 6.4, I am no longer able to run the tcl based tool. I am getting the following error and I have no internet access on this server. Kindly advise how do I solve this problem?
Thanks
"XpUtils::iload -d /usr/local/testtool/repo/package/linux-glibc2.3-x86_64/lib/tcljava1.4.1 tclblend" failed:
couldn't load file "/usr/local/testtool/repo/package/linux-glibc2.3-x86_64/lib/tcljava1.4.1/libtclblend.so": libjava.so: cannot open shared object file: No such file or directory
while executing
"error "\"XpUtils::iload -d $dir tclblend\" failed:\n $errMsg""
(procedure "loadtclblend" line 168)
invoked from within
"loadtclblend /usr/local/testtool/repo/package/linux-glibc2.3-x86_64/lib/tcljava1.4.1"
("package ifneeded java 1.4.1" script)
invoked from within
"package require java"
("eval" body line 1)
invoked from within
"eval package require $pkg"
("foreach" body line 2)
invoked from within
"foreach pkg $pkgList {
set ::${pkg}Version [eval package require $pkg]
}"
(file "/usr/local/testtool/testtool" line 165)
If you read the error message trace, you'll see that it says that this is all caused by:
libjava.so: cannot open shared object file: No such file or directory
The first steps would then be to ensure that you've got a version of Java actually installed, to check that it includes the file libjava.so, and that the file has been indexed by the system shared library catalog.
It might also be worth checking that all its dependencies are also present and that you've got the architecture for the Tcl library and the Java library matched (e.g., both 32-bit) as those can cause odd failures when they go wrong.

How to use Compass through JRuby, for embedding in my soft'?

I've to "compile" compass files dynamically in my java soft'. So, following explications found on stackoverflow, I've done these steps :
Get JRuby (1.7.3), configure PATH to jruby.jar and binaries (gem, rake ...) and learn to launch ruby script from Java
Get compass and dependancies gems into a local directory, using following command line
gem install -i ./compass compass
=> So I get a directory ./compass/ containing bin, cache,doc, gems & specifications directories.
Put gems in a jar using following command line (think to use a jar name which is not the same as the gems, to avoid JRuby "require" the jar instead of the gems)
jar cf compass-lib.jar -C compass .
Write a test script test.rb in local directory to test my jar. It contains :
require 'compass'
Compass.add_configuration(
{
:project_path => '.',
:sass_path => 'styles/scss',
:css_path => 'styles/css'
},
'custom' # A name for the configuration, can be anything you want
)
Compass.compiler.compile('test.scss', 'test.css')
Execute this script with JRuby, with following command line :
jruby -I . -rcompass-lib.jar test.rb
And get this error ...
Unable to load Sass. Please install it with one of the following commands:
gem install sass --pre
LoadError: no such file to load -- jar:file:C:/jruby-1.7.3/lib/jruby.jar!/gems/s
ass-3.2.8/lib/sass/../sass
require at org/jruby/RubyKernel.java:1027
require at c:/jruby-1.7.3/lib/ruby/shared/rubygems/custom_require.rb:36
(root) at jar:file:C:/jruby-1.7.3/lib/jruby.jar!/gems/sass-3.2.8/lib/sass/ver
sion.rb:5
require at org/jruby/RubyKernel.java:1027
(root) at c:/jruby-1.7.3/lib/ruby/shared/rubygems/custom_require.rb:1
require at c:/jruby-1.7.3/lib/ruby/shared/rubygems/custom_require.rb:36
require at org/jruby/RubyKernel.java:1027
(root) at jar:file:C:/jruby-1.7.3/lib/jruby.jar!/gems/sass-3.2.8/lib/sass.rb:
9
(root) at c:/jruby-1.7.3/lib/ruby/shared/rubygems/custom_require.rb:1
require at org/jruby/RubyKernel.java:1027
require at c:/jruby-1.7.3/lib/ruby/shared/rubygems/custom_require.rb:60
(root) at jar:file:C:/jruby-1.7.3/lib/jruby.jar!/gems/compass-0.12.2/lib/comp
ass/dependencies.rb:6
each at org/jruby/RubyArray.java:1613
(root) at c:/jruby-1.7.3/lib/ruby/shared/rubygems/custom_require.rb:1
require at org/jruby/RubyKernel.java:1027
require at c:/jruby-1.7.3/lib/ruby/shared/rubygems/custom_require.rb:36
(root) at test.rb:1
An idea of the problem and, maybe, of solution ? ;) Thanks by advance.
[UPDATE #1]
After Jörg W Mittag obvious suggestion, the error disapear. Thanks ;) Now, it just don't find the scss file, so it's a "normal problem" ;)
[UPDATE #2]
Having used compass with success in IRB, it's time to transpose the test through Java. So, I wrote some lines in Java to execute my ruby script, using only absolute path to avoid problems in a first time.
InputStream myFile = ISRessources.getFile("C:/Path/To/My/test.rb");
new ScriptingContainer().runScriptlet(myFile, "test.rb");
But ... how to "load" my compass-lib.jar ? What's the equivalent of the -r in JRuby ? I've tried to includ gems into jruby.jar, to add compass-lib.jar in externals jars in java build path, but both don't work, I still have :
LoadError: no such file to load -- compass
require at org/jruby/RubyKernel.java:1027
(root) at test.rb:1
Any idea ?
The error message says:
Unable to load Sass. Please install it with one of the following commands:
gem install sass --pre

Xcode 4.5.1: Linker Error: NSJavaVirtualMachine, symbol not found for architecture i386

I am trying to call a Java class from an objective C, iPhone 5 application. I am using Xcode 4.5.1. At this stage, I can't even load the Virtual Machine without the following error:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_NSJavaVirtualMachine", referenced from:
objc-class-ref in main.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
These are the steps I have followed,
1) In main.m:
#autoreleasepool {
[NSJavaVirtualMachine defaultVirtualMachine]; //Added this line to load the Java VM.
id vector=[[NSClassFromString(#"java.util.Vector") alloc] init];
[vector add:#"one item!"];
NSLog(#"item 1=%#",[vector get:0]);
return 0;
}
2) I added the JavaVM.Framework by:
(right click on) frameworks -> "add files to project" -> JavaVM.Framework -> (Copy Items into destination group's folder and Create Folder References... -> Click Add
(It also shows up at Build Phases -> Link Binary with Libraries)
3) In info.plist, the following properties were added:
Cocoa Java Application = Yes
Java Class Path and Java Root Directory
Both were set to the global directory where I'm storing my Java files.
I'm trying to call the add and get functions of the Java class Vector. But I can't seem to load the VM into Xcode at all!
Please help.
You can't NSJavaVirtualMachine on iOS. The Cocoa/Java bindings are only available OS X and even there they are deprecated.

Categories