• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Classpath problem?

 
tim smit
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was trying to run a slight modification of weka as provided by the university of texas (austin), available at: http://www.cs.utexas.edu/users/ml/risc/code/

I'm running it on a x86_64 Linux platform:
Linux version 2.6.9-42.ELsmp (bhcompile@ls20-bc1-13.build.redhat.com) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-2)) #1 SMP Wed Jul 12 23:32:02 EDT 2006

I have installed java in my local directory, and have modified the Makefile accordingly.The makefile specifies the paths as:

------------------------------------
# Java version to use
JAVADIR = /home/ts/java/j2sdk1.4.2_16

CLASSPATH = ${JAVADIR}:${INSTALL_DIR}/weka-latest/weka/core/metrics:./:../:../../:../../../:${INSTALL_DIR}/packages/rmn.jar:${INSTALL_DIR}/packages/Jama-1.0.1.jar
:${INSTALL_DIR}/packages/cplex.jar:${INSTALL_DIR}/packages/jmage.jar:${INSTALL_DIR}/packages/ir.jar:${INSTALL_DIR}/packages/jmatlink.jar

[ The above lines are really joined; I added a line break for readability - Jim ]

------------------------------------

I get the following errors when trying to run from the command line:

-------------------------------------------------------------------------------------

$ $ java weka/clusterers/MPCKMeans -D data/iris.arff -C data/iris.constraints

..
..
Exception in thread "main" java.lang.NoClassDefFoundError: while resolving class: weka.core.metrics.WeightedMahalanobis
at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib64/libgcj.so.5.0.0)
at java.lang.Class.initializeClass() (/usr/lib64/libgcj.so.5.0.0)
at java.lang.Class.isInstance(java.lang.Object) (/usr/lib64/libgcj.so.5.0.0)
at weka.clusterers.MPCKMeans.calculateMaxCLPenalties() (Unknown Source)
at weka.clusterers.MPCKMeans.runKMeans() (Unknown Source)
at weka.clusterers.MPCKMeans.buildClusterer(weka.core.Instances) (Unknown Source)
at weka.clusterers.MPCKMeans.buildClusterer(weka.core.Instances, int) (Unknown Source)
at weka.clusterers.MPCKMeans.buildClusterer(java.util.ArrayList, weka.core.Instances, weka.core.Instances, int, int) (Unknown Source)
at weka.clusterers.MPCKMeans.runFromCommandLine(java.lang.String[]) (Unknown Source)
at weka.clusterers.MPCKMeans.main(java.lang.String[]) (Unknown Source)
Caused by: java.lang.ClassNotFoundException: Jama.Matrix not found in [file:/usr/share/java/libgcj-3.4.6.jar, file:./, core:/]
at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib64/libgcj.so.5.0.0)
at gnu.gcj.runtime.VMClassLoader.findClass(java.lang.String) (/usr/lib64/libgcj.so.5.0.0)
at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib64/libgcj.so.5.0.0)
at _Jv_FindClass(_Jv_Utf8Const, java.lang.ClassLoader) (/usr/lib64/libgcj.so.5.0.0)
at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib64/libgcj.so.5.0.0)
at _Jv_BytecodeVerifier.type.compatible(_Jv_BytecodeVerifier.type&, _Jv_BytecodeVerifier) (/usr/lib64/libgcj.so.5.0.0)
at _Jv_BytecodeVerifier.verify_instructions_0() (/usr/lib64/libgcj.so.5.0.0)
at _Jv_VerifyMethod(_Jv_InterpMethod) (/usr/lib64/libgcj.so.5.0.0)
at _Jv_PrepareClass(java.lang.Class) (/usr/lib64/libgcj.so.5.0.0)
at _Jv_WaitForState(java.lang.Class, int) (/usr/lib64/libgcj.so.5.0.0)
at java.lang.VMClassLoader.linkClass0(java.lang.Class) (/usr/lib64/libgcj.so.5.0.0)
at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib64/libgcj.so.5.0.0)


------------------------------------------------------------------------------------

Where am I configuring the classpath incorrectly (why is it going to /usr/lib64/libgcj.so.5.0.0)? Any insight would be highly appreciated.

thanks!
[ October 22, 2007: Message edited by: Jim Yingst ]
 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[tim smit]Any insight would be highly appreciated.
In no paticular order, and until someone else who knows more comes along:
  • weka is experimental, java was finding things util it got to the WeightedMahalanobis
  • Put your code inside code tags, there are some squarish script buttons below the text area, use code.gif marked "code" - put any code between the [ tag ] - code goes here - [ /tag ], format as you would in an editor except don't let the lines get very long. There is a constant battle to get a balance in all the information needed compared to available screen space.
  • Where do you get the weka-latest/weka/core/metrics:./:../:../../:../../..semantics and what are the colons ? { this may be unice conventions, i work in winnie the poo land } ';' is the path separator, not ':' - that may be your problem.


  •  
    Jim Yingst
    Wanderer
    Sheriff
    Posts: 18671
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Focusing on these two parts:

    CLASSPATH=[...]:${INSTALL_DIR}/weka-latest/weka/core/metrics:[...]

    Exception in thread "main" java.lang.NoClassDefFoundError: while resolving class: weka.core.metrics.WeightedMahalanobis


    It looks like weka.core.metrics is the package name. If ${INSTALL_DIR}/weka-latest/weka/core/metrics contains a file WeightedMahalanobis.class, then your CLASSPATH should contain the root directory ${INSTALL_DIR}/weka-latest/ - you don't need to add the weka/core/metrics directories, as those will be inferred from the package name.
    [ October 22, 2007: Message edited by: Jim Yingst ]
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic