Raghuveer
Raghuveer

Reputation: 3057

jnetpcap library unable to build on ubuntu 12.04

I am trying to install JNetPcap and followed the instructions given at here. At step 12, I am unable to run the ant command and i see the error

Error: JAVA_HOME is not defined correctly.
We cannot execute /usr/lib/jvm/java-6-sun/bin/java

As I am able to run Java classes from eclipse or from command line I don't think if it's a problem with JAVA_HOME.

echo $PATH shows

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/java-6-sun/bin

Kindly let me know if am missing something here.

thanks in advance

Upvotes: 0

Views: 757

Answers (1)

Stephen C
Stephen C

Reputation: 718906

Neither running java from the command line or running eclipse will require JAVA_HOME to be set. However, the build procedure you are trying to use ant, and ant often does require JAVA_HOME to be set appropriately. (It actually depends on the version of ant that you are using. The use of JAVA_HOME is typically in the wrapper script for ant.)

Just set it.

JAVA_HOME should probably be set to /usr/lib/jvm/java-6-sun ... based on what you gave said PATH to.

However, it is also possible that the problem is that your PATH is incorrect. Or that you have (somehow) managed to get the owner/group/permissions on your Java install incorrect, such that the java command isn't executable.

  1. Check that running java -version displays the installed Java version.

  2. Repeat with /usr/lib/jvm/java-6-sun/bin/java -version.

Upvotes: 0

Related Questions