Reputation: 225
I'd like to run a java package for measuring quality of my community detection algorithm but I encounter following error:
Standalone.java:22: error: package org.apache.commons.collections15 does not exist
It seems the package is not by default installed in java, since I already installed java using
sudo apt-get install default-jdk
and similar commands.
I find the package in https://github.com/cloudera/collections-generic which contains collection 15. Java is not my programming language and I don't know how to install the package; should I place it in specific folder.
Upvotes: 0
Views: 16942
Reputation: 3814
Java has a concept referred to as library dependencies which (in this case) you can think of as extensions to Java's core API. In layman's terms they're self contained "units" of code that give you access to programmatic structures (methods, classes, interfaces, etc) that do not come defaualt in Java. Some additional information
The error in this case is telling us a few things. Firstly it is telling us that the error is occurring in the Standalone.java file on line 22. Additionally it is telling us that the issue is occurring because the Apache Commons library is no present. If you view the Standalone.java file you will see the following import on line 22
A general solution to this problem depends solely on how you are building this application. In generally you need to do the following:
In the projects root directory you will see a .classpath file. This file is generated by the Eclipse IDE that defines the projects classpath. This file should have an entry that somewhere points to the Commons jar file. On line 3 you will see the following classpath entry with these two pertinent attributes
I believed the the issue here is with the sourcepath attribute. It is clearly assigned an absolute URI that is (presumably) not applicable to you. Try to assign it the same value as the path attribute.
Upvotes: 3
Reputation: 8386
org.apache.commons.collections15 is available in apache commons collection jar. You need to have the jar in your classpath.
If you are using maven then add this in your pom.xml
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.0</version>
</dependency>
Upvotes: 6