Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to Find Supporting Jars for Java Compilation in General
    primarykey
    data
    text
    <p>I understand a lot of people find tools such as Maven and Eclipse useful for building and compiling Java applications, especially with handling dependencies. But I have a question which relates to compiling and running java apps from the command line, especially with many dependencies. I would appreciate an answer which is less like "dont do that" because that wont help what I am working on. For example, if you are working through the first example of recommendation in Mahout from Mahout in Action, it doesn't seem obvious how to compile and run the example from the command line: </p> <pre><code>javac -cp /usr/lib/mahout/mahout-core-0.7-cdh4.2.0.jar RecommenderIntro.java </code></pre> <p>This completes without error. However the next issue is actually running the output which seems to need more dependencies. As you can imagine this is frustrating!</p> <pre><code>$ java -cp /usr/lib/mahout/mahout-core-0.7-cdh4.2.0.jar:. RecommenderIntro Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at org.apache.mahout.cf.taste.impl.model.file.FileDataModel.&lt;clinit&gt;(FileDataModel.java:121) at RecommenderIntro.main(RecommenderIntro.java:19) Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) ... 2 more </code></pre> <p>However, it seems pretty obvious, that most or all of the jars you need come from /usr/lib/mahout/lib. Is there a way I can find out what the full list of jars I need to add to my classpath during compilation is, for a given set of import statements? One reason that this is important is that I am using the Cloudera distribution of Mahout, and not the Apache version, so the authors are do not seem interested in helping. In other languages, such as python, it is much easier, do many Java programmers deal with command line compilation issues, such as these? And if so, how?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload