Hi,

Issue above have been solved.
I had to modify the build.xml file on JUNIT_HOME path content as per below (to fit to my system):

<!-- These paths should be relative to JUNIT_HOME -->
    <property name="junit4" value="junit4-4.12.jar" />
    <property name="hamcrest-core" value="hamcrest-core-1.3.jar" />
    <property name="ant-junit4" value="ant-junit4.jar" />

In my system :
it is <property name="junit4" value="junit4-4.12.jar" />  instead of property name="junit4" value="junit-4.12.jar" />r
<property name="ant-junit4" value="ant-junit4.jar" /> instead of <property name="ant-junit4" value="ant/ant-junit4.jar" />

Thanks for your help

Hi Chris,

The indicated directory is empty I can't retrieve the file.
Please find below the output of the compilation on my terminal;it may help you to help me...

root@pitt-Aspire-5742G:~/WOLFSSL/wolfssl-jni-1.3.0# ant
Buildfile: /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/build.xml

clean:
   [delete] Deleting directory /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/build/test
   [delete] Deleting directory /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/build
   [delete] Deleting directory /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/examples/build

default-javac-flags:

init:
    [mkdir] Created dir: /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/build
    [mkdir] Created dir: /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/examples/build
    [mkdir] Created dir: /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/build/test
    [mkdir] Created dir: /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/build/reports

compile:
    [javac] Compiling 23 source files to /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/build

jar:
      [jar] Building jar: /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/lib/wolfssl.jar

javah:

javadoc:
  [javadoc] Generating Javadoc
  [javadoc] Javadoc execution
  [javadoc] Loading source files for package com.wolfssl...
  [javadoc] Loading source files for package com.wolfssl.wolfcrypt...
  [javadoc] Constructing Javadoc information...
  [javadoc] Standard Doclet version 1.8.0_121
  [javadoc] Building tree for all the packages and classes...
  [javadoc] Building index for all the packages and classes...
  [javadoc] Building index for all classes...

examples:
    [javac] Compiling 28 source files to /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/examples/build

build-test:
    [javac] Compiling 6 source files to /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/build/test
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfCryptECCTest.java:24: error: package org.junit does not exist
    [javac] import org.junit.Test;
    [javac]                 ^
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfCryptECCTest.java:25: error: package org.junit.runner does not exist
    [javac] import org.junit.runner.RunWith;
    [javac]                        ^
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfCryptECCTest.java:26: error: package org.junit.runners does not exist
    [javac] import org.junit.runners.JUnit4;
    [javac]                         ^
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfCryptECCTest.java:27: error: package org.junit does not exist
    [javac] import static org.junit.Assert.*;
    [javac]                        ^
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfCryptRSATest.java:24: error: package org.junit does not exist
    [javac] import org.junit.Test;
    [javac]                 ^
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfCryptRSATest.java:25: error: package org.junit.runner does not exist
    [javac] import org.junit.runner.RunWith;
    [javac]                        ^
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfCryptRSATest.java:26: error: package org.junit.runners does not exist
    [javac] import org.junit.runners.JUnit4;
    [javac]                         ^
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfCryptRSATest.java:27: error: package org.junit does not exist
    [javac] import static org.junit.Assert.*;
    [javac]                        ^
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLContextTest.java:24: error: package org.junit does not exist
    [javac] import org.junit.Test;
    [javac]                 ^
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLContextTest.java:25: error: package org.junit.runner does not exist
    [javac] import org.junit.runner.RunWith;
    [javac]                        ^
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLContextTest.java:26: error: package org.junit.runners does not exist
    [javac] import org.junit.runners.JUnit4;
    [javac]                         ^
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLContextTest.java:27: error: package org.junit does not exist
    [javac] import static org.junit.Assert.*;
    [javac]                        ^
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLSessionTest.java:24: error: package org.junit does not exist
    [javac] import org.junit.Test;
    [javac]                 ^
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLSessionTest.java:25: error: package org.junit.runner does not exist
    [javac] import org.junit.runner.RunWith;
    [javac]                        ^
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLSessionTest.java:26: error: package org.junit.runners does not exist
    [javac] import org.junit.runners.JUnit4;
    [javac]                         ^
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLSessionTest.java:27: error: package org.junit does not exist
    [javac] import static org.junit.Assert.*;
    [javac]                        ^
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLTest.java:24: error: package org.junit does not exist
    [javac] import org.junit.Test;
    [javac]                 ^
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLTest.java:25: error: package org.junit does not exist
    [javac] import org.junit.BeforeClass;
    [javac]                 ^
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLTest.java:26: error: package org.junit.runner does not exist
    [javac] import org.junit.runner.RunWith;
    [javac]                        ^
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLTest.java:27: error: package org.junit.runners does not exist
    [javac] import org.junit.runners.JUnit4;
    [javac]                         ^
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLTest.java:28: error: package org.junit does not exist
    [javac] import static org.junit.Assert.*;
    [javac]                        ^
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLTestSuite.java:24: error: package org.junit.runner does not exist
    [javac] import org.junit.runner.RunWith;
    [javac]                        ^
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLTestSuite.java:25: error: package org.junit.runners does not exist
    [javac] import org.junit.runners.Suite;
    [javac]                         ^
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLTestSuite.java:27: error: cannot find symbol
    [javac] @RunWith(Suite.class)
    [javac]  ^
    [javac]   symbol: class RunWith
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLTestSuite.java:28: error: package Suite does not exist
    [javac] @Suite.SuiteClasses({
    [javac]       ^
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfCryptECCTest.java:35: error: cannot find symbol
    [javac]     @Test
    [javac]      ^
    [javac]   symbol:   class Test
    [javac]   location: class WolfCryptECCTest
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfCryptRSATest.java:35: error: cannot find symbol
    [javac]     @Test
    [javac]      ^
    [javac]   symbol:   class Test
    [javac]   location: class WolfCryptRSATest
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLContextTest.java:43: error: cannot find symbol
    [javac]     @Test
    [javac]      ^
    [javac]   symbol:   class Test
    [javac]   location: class WolfSSLContextTest
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLSessionTest.java:44: error: cannot find symbol
    [javac]     @Test
    [javac]      ^
    [javac]   symbol:   class Test
    [javac]   location: class WolfSSLSessionTest
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLTest.java:36: error: cannot find symbol
    [javac]     @BeforeClass
    [javac]      ^
    [javac]   symbol:   class BeforeClass
    [javac]   location: class WolfSSLTest
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLTest.java:45: error: cannot find symbol
    [javac]     @Test
    [javac]      ^
    [javac]   symbol:   class Test
    [javac]   location: class WolfSSLTest
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLContextTest.java:77: error: cannot find symbol
    [javac]                     fail("failed to create WolfSSLContext object");
    [javac]                     ^
    [javac]   symbol:   method fail(String)
    [javac]   location: class WolfSSLContextTest
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLContextTest.java:85: error: cannot find symbol
    [javac]             fail("failure case improperly succeeded, WolfSSLContext()");
    [javac]             ^
    [javac]   symbol:   method fail(String)
    [javac]   location: class WolfSSLContextTest
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLContextTest.java:121: error: cannot find symbol
    [javac]                 fail(name + " failed");
    [javac]                 ^
    [javac]   symbol:   method fail(String)
    [javac]   location: class WolfSSLContextTest
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLContextTest.java:167: error: cannot find symbol
    [javac]                 fail(name + " failed");
    [javac]                 ^
    [javac]   symbol:   method fail(String)
    [javac]   location: class WolfSSLContextTest
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLContextTest.java:212: error: cannot find symbol
    [javac]                 fail(name + " failed");
    [javac]                 ^
    [javac]   symbol:   method fail(String)
    [javac]   location: class WolfSSLContextTest
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLContextTest.java:298: error: cannot find symbol
    [javac]                 fail("usePskIdentityHint failed");
    [javac]                 ^
    [javac]   symbol:   method fail(String)
    [javac]   location: class WolfSSLContextTest
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLSessionTest.java:71: error: cannot find symbol
    [javac]             fail("failed to create WolfSSLSession object");
    [javac]             ^
    [javac]   symbol:   method fail(String)
    [javac]   location: class WolfSSLSessionTest
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLSessionTest.java:132: error: cannot find symbol
    [javac]                 fail(name + " failed");
    [javac]                 ^
    [javac]   symbol:   method fail(String)
    [javac]   location: class WolfSSLSessionTest
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLSessionTest.java:142: error: cannot find symbol
    [javac]                 fail(name + " failed");
    [javac]                 ^
    [javac]   symbol:   method fail(String)
    [javac]   location: class WolfSSLSessionTest
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLSessionTest.java:188: error: cannot find symbol
    [javac]                 fail(name + " failed");
    [javac]                 ^
    [javac]   symbol:   method fail(String)
    [javac]   location: class WolfSSLSessionTest
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLSessionTest.java:274: error: cannot find symbol
    [javac]                 fail("usePskIdentityHint failed");
    [javac]                 ^
    [javac]   symbol:   method fail(String)
    [javac]   location: class WolfSSLSessionTest
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLSessionTest.java:289: error: cannot find symbol
    [javac]                 fail("getPskIdentityHint failed");
    [javac]                 ^
    [javac]   symbol:   method fail(String)
    [javac]   location: class WolfSSLSessionTest
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLTest.java:41: error: cannot find symbol
    [javac]             fail("failed to load native JNI library");
    [javac]             ^
    [javac]   symbol:   method fail(String)
    [javac]   location: class WolfSSLTest
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLTest.java:63: error: cannot find symbol
    [javac]             fail("failed to load native JNI library");
    [javac]             ^
    [javac]   symbol:   method fail(String)
    [javac]   location: class WolfSSLTest
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLTest.java:66: error: cannot find symbol
    [javac]             fail("failed to create WolfSSL object");
    [javac]             ^
    [javac]   symbol:   method fail(String)
    [javac]   location: class WolfSSLTest
    [javac] /home/pitt/WOLFSSL/wolfssl-jni-1.3.0/src/test/com/wolfssl/WolfSSLTest.java:95: error: cannot find symbol
    [javac]             fail("method test failed, method was null");
    [javac]             ^
    [javac]   symbol:   method fail(String)
    [javac]   location: class WolfSSLTest
    [javac] 47 errors

BUILD FAILED
/home/pitt/WOLFSSL/wolfssl-jni-1.3.0/build.xml:140: Compile failed; see the compiler error output for details.

Total time: 8 seconds
root@pitt-Aspire-5742G:~/WOLFSSL/wolfssl-jni-1.3.0#

I'm doing the building/compilation using the terminal. Do you think that using eclipse is a better way?
Is there any user guide for wolfssl users on Eclipse?

chrisc wrote:

Hi,

Do you have the JUNIT_HOME environment variable set?  It should be pointing to the location where the following JAR files are located:

junit-4.12.jar
hamcrest-core-1.3.jar
ant/ant-junit4.jar

Best Regards,
Chris

Hi Chris,

Thank you very much for your reply.
I have set the environment variable JUNIT_HOME pointing to the location; indeed the location is /usr/share/java but it's still failing (now with error message : /home/pitt/Downloads/WOLFSSL/wolfssl-jni-1.3.0/build.xml:146: Test com.wolfssl.WolfSSLTestSuite failed

I have 3 more questions:
1° is ant/ant-junit4.jar a file or I should have ant-junit4.jar file in a directory ant of the JUNIT_HOME : usr/share/java/ant/ant-junit4.jar  ?
2° in which file is the  JUNIT_HOME environment variable set? is it in etc/environment file or in the bashrc file ?
3° What does indicate the error number (i.e 146 in the error message "BUILD FAILED /home/pitt/wolfssl-jni-1.3.0/build.xml:146: Compile failed; see the compiler error output for details.) after doing some changes I get 146 or 140 or 91,...

Thanks for helping

Hello,

I have been struggling with compilation of the JNI interface of wolfssl.
I followed the whole process as described by the user guide but i still get error "BUILD FAILED"  {env.JUNIT_HOME} does not exist.



Can someone help,please.

Thanks

p.s:
Below commands were successfully executed :

$ cd wolfssl-3.7.0

$ ./configure --enable-jni

$ make

$ sudo make install

$ ./java.sh

This one failed :
$ ant