Unable to build JCIFS jar file - java

I had installed the apache ant and I would like to make the SMB library into a jar file together with the java/class that I had created.
I tried entering the "ant jar" into the cmd. however, I dont seem to be able to build it as I keep getting this error.
BUILD FAILED
D:\SMB_JAR_FILES\SMB Java Files\jcifs-master\build.xml:45: The following error o
ccurred while executing this line:
D:\SMB_JAR_FILES\SMB Java Files\jcifs-master\build.xml:34: The Java Servlet API
classes could not be found. These files can be
obtained from:
http://java.sun.com/products/servlet/download.html
Total time: 0 seconds
Could Someone please teach me how to fix this ? May I know if I am missing anything. Thank you.
After I had downloaded the Servlet.api
I encounter another error
dependencies:
hasServlet:
compile:
[javac] D:\SMB_JAR_FILES\SMB Java Files\jcifs-master\build.xml:57: warning:
'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to f
alse for repeatable builds
[javac] Compiling 178 source files to D:\SMB_JAR_FILES\SMB Java Files\jcifs-
master\build
BUILD FAILED
D:\SMB_JAR_FILES\SMB Java Files\jcifs-master\build.xml:57: Error running \usr\lo
cal\java5\bin\javac compiler
Total time: 0 seconds

Related

Error occurred during initialization of VM Unable to load native library:

I have JRE made for Android. I am trying to execute /data/local/tmp/j/java but that gives
following error:
Error occurred during initialization of VM Unable to load native library:
The other files for java are at: /data/local/tmp/java.
I have executed following commands:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/tmp/java/lib/jli
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/tmp/java/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/tmp/java/lib/server
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/tmp/java
But the same error as above is still showing. The reason why i have moved java executable to /data/local/tmp/j/java is because on Android you can only execute and include lib[name].so files in jniLibs/abi so i am unable to move bin, lib folders to /jniLibs/abi.
I would be very grateful if someone could help me out with this as i am working for days to get this completed.

Error on using pjsua2 in Netbeans

I compiled pjsip, and now I'm trying to use pjsua2 in netbeans for an linux application. Using Swig I was able to get the java code, witch I copied as a package of my project. The project is in github on this link:
https://github.com/eduardobonfa/PjsipLinux
But when I try to run I got the following error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.pjsip.pjsua2.pjsua2JNI.swig_module_init()V
at org.pjsip.pjsua2.pjsua2JNI.swig_module_init(Native Method)
at org.pjsip.pjsua2.pjsua2JNI.<clinit>(pjsua2JNI.java:2619)
at org.pjsip.pjsua2.Endpoint.<init>(Endpoint.java:68)
at javaapplication3.test.main(MyAccount.java:44)
/home/eduardo/.cache/netbeans/8.2/executor-snippets/run.xml:53: Java returned: 1
BUILD FAILED (total time: 0 seconds)
What Do I need to do?
I compiled the pjsip using the following steps:
./configure --enable-shared --prefix=/usr/lib
make dep && make && make install
go to swig folder
make
Got the java code and put in my project
Am I missing something??

Configure Eclipse Plugin for Apache Hadoop2.7.2

I am using this for configuring eclipse in windows 8.1. I compiled hadoop 2.7.2; when I entered
ant jar -Dversion=2.7.2 -Declipse.home=C:/eclips/eclipse -Dhadoop.home=D:/Hadoop/hadoop-2.7.2
Buildfile:C:\hadoop2x-eclipse-plugin\src\contrib\eclipse-plugin\build.xml
I got lots of errors. I don't know where I should find compiler output and what is NewDriverWizard?
pache\hadoop\eclipse\NewDriverWizard.java:22: error: package org.eclipse.core.ru
ntime does not exist
[javac] C:\hadoop2x-eclipse-plugin\src\contrib\eclipse-plugin\src\java\org\a
pache\hadoop\eclipse\NewDriverWizard.java:24: error: package org.eclipse.jdt.cor
e does not exist
[javac] C:\hadoop2x-eclipse-plugin\src\contrib\eclipse-plugin\src\java\org\a
pache\hadoop\eclipse\NewDriverWizard.java:25: error: package org.eclipse.jdt.int
ernal.ui.wizards does not exist
.
.
.
BUILD FAILED
C:\hadoop2x-eclipse-plugin\src\contrib\eclipse-plugin\build.xml:76: Compile fail
ed; see the compiler error output for details.

IntelliJ 14 Unable to generate JavaFX exe

I am trying to package an app to an exe file, (including java8, so it is self contained). The app needs to run on any machine even if java is not installed.
Here is a screenshot of my settings:
I get this as an error:
Error:Java FX Packager:
BUILD FAILED
/home/foo/.IntelliJIdea14/system/compile-server/_temp_/build0.xml:11:
Total time: 0 seconds
Error:Java FX Packager: Buildfile: /home/foo/.IntelliJIdea14/system/compile-server/_temp_/build0.xml
build artifact:
Error:Java FX Packager: fx:deploy task has failed.
Now what am I supposed to get from this error ?
How can I fix this and get my app executable?

`create` script for Cordova Android fails to create new project - errors with java/ant configuration

I'm trying to create a new Android project using Cordova/Phonegap.
I have downloaded cordova-2.9.0, and the ADT Bundle for Mac.
I extracted ADT to ~/Developer/Android, and added it to my PATH:
export PATH="$HOME/Development/Android/sdk/tools:$PATH"
export PATH="$HOME/Development/Android/sdk/platform-tools:$PATH"
I then try to run the cordova create script, but it fails:
→ bin sudo ./create ~/Projects/myproject/cordova-android com.mydomain.myproject myproject
Password:
BUILD FAILED
/Users/asgeo1/Development/Android/sdk/tools/ant/build.xml:714: The following error occurred while executing this line:
/Users/asgeo1/Development/Android/sdk/tools/ant/build.xml:728: Compile failed; see the compiler error output for details.
Total time: 1 second
An unexpected error occurred: ant jar > /dev/null exited with 1
Deleting project...
Not very helpful. So I edit the Cordova create script so it will output some more information.
# COMMENTED OUT piping to /dev/null:
#
# compile cordova.js and cordova.jar
pushd "$BUILD_PATH"/framework # > /dev/null
ant jar #> /dev/null
popd #> /dev/null
Then I re-ran the create script:
→ bin sudo ./create ~/Projects/myproject/cordova-android com.mydomain.myproject myproject
~/Downloads/cordova-2.9.0/cordova-android/framework ~/Downloads/cordova-2.9.0/cordova-android/bin
Buildfile: /Users/asgeo1/Downloads/cordova-2.9.0/cordova-android/framework/build.xml
-pre-build:
-check-env:
[checkenv] Android SDK Tools Revision 22.0.5
[checkenv] Installed at /Users/asgeo1/Development/Android/sdk
-setup:
[echo] Project Name: Cordova
[gettype] Project Type: Android Library
-build-setup:
[getbuildtools] Using latest Build Tools: 18.0.1
[echo] Resolving Build Target for Cordova...
[gettarget] Project Target: Android 4.3
[gettarget] API level: 18
[echo] ----------
[echo] Creating output directories if needed...
[echo] ----------
[echo] Resolving Dependencies for Cordova...
[dependency] Library dependencies:
[dependency] No Libraries
[echo] ----------
[echo] Building Libraries with '${build.target}'...
[subant] No sub-builds to iterate on
-code-gen:
[mergemanifest] No changes in the AndroidManifest files.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
[echo] ----------
[echo] Handling Resources...
[aapt] No changed resources. R.java and Manifest.java untouched.
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.
-pre-compile:
-compile:
[javac] Compiling 104 source files to /Users/asgeo1/Downloads/cordova-2.9.0/cordova-android/framework/bin/classes
[javac] /Users/asgeo1/Downloads/cordova-2.9.0/cordova-android/framework/src/com/squareup/okhttp/Connection.java:171: method does not override a method from its superclass
[javac] #Override public void close() throws IOException {
[javac] ^
And there's another 40 errors like the one above, regarding #override.
From what I can tell on Google, this is because in jdk 1.6 and above, the #override annotations changed. (or something like that):
Why is javac failing on #Override annotation
OK, so I work out that the Android SDK configuration for ant is in a file called build.xml. Low and behold, it has some settings for Java 1.5:
<property name="java.target" value="1.5" />
<property name="java.source" value="1.5" />
If I change those values to 1.6 or 1.7, I get a java error when re-running the Cordova create script:
-compile:
[javac] Compiling 104 source files to /Users/asgeo1/Downloads/cordova-2.9.0/cordova-android/framework/bin/classes
[javac] javac: invalid source release: 1.7
[javac] Usage: javac <options> <source files>
I'm really scratching my head here. I'm not an expert on Java, so I don't get what is going on here.
Does anyone know how to run the create script for Cordova Android on OSX ?
UPDATE
After following #cartland's advice below I was able to get rid of the #Override errors. Still getting one last error though:
-compile:
[javac] Compiling 104 source files to /Users/asgeo1/Downloads/cordova-2.9.0/cordova-android/framework/bin/classes
[javac] /Users/asgeo1/Downloads/cordova-2.9.0/cordova-android/framework/src/org/apache/cordova/InAppBrowser.java:523: error: cannot find symbol
[javac] settings.setPluginsEnabled(true);
[javac] ^
[javac] symbol: method setPluginsEnabled(boolean)
[javac] location: variable settings of type WebSettings
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] 1 error
I'll try and work out what that is - but if anyone knows, please post an answer :)
UPDATE 2
I know what the 2nd error is. It's mentioned here: https://developer.motorolasolutions.com/thread/3640
Cordova 2.9.0 is not compatible with Android SDK 18. I need to use Cordova 3.0.0 with Android SDK 18. (or conversely downgrade the Android SDK to 17)
I'm running Ubuntu 10.4 64bit; Oracle JDK 1.7.0_25-b15; Eclipse Kepler; Android SDK 4.3; PhoneGap 3.0.
Had exactly the same problem as you using the CLI. Loading the project into Eclipse worked fine (~/.cordova/lib/android/cordova/3.0.0/framework/.project). As Eclipse uses it's own internal Java compiler, I figured there was a problem with the Oracle install I was using, and there was - sort of.
It turned out that some application had installed a version of tools.jar (amongst others) from an earlier JRE into the Java ext folder. Seems strange to me that javac would load dependant jars from here prior to jars in it's own lib folder but that seems to be the precedence order. Anyway, I removed all files from the ext folder and everything worked properly.
JDK location: /usr/lib/jvm/java-7-oracle/
Ext location: /usr/java/packages/lib/ext/
I don't have my Mac on me to check locations but try /Library/Java/Extensions or ~/Library/Java/Extensions
I didn't need to make any other changes. However while experimenting, I did try setting the following properties in the project's ant.properties file. 1.5, 1.6, 1.7 all work.
java.target=1.5
java.source=1.5
Actually, the problem here seems to be the incompatibility between your java version and Cordova's compiled jars.
For a quick fix, it is better to install Java 1.5 and use it for your development. Don't forget to restore your changes in build.xml to 1.5.

Categories

Resources