Archive for the ‘Java’ Category

The Java UnsupportedClassVersionError

March 26, 2013 Leave a comment

I was having an error when compile one piece of code within Eclipse.

java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version;/CareMonths, offset=6

Got some help from here, which thinks that the reason of the error is because of the unmatched jdk version. And of course, install it.

So tried a simple fix, and it works:

1. go to here download the right version, I am downloading the newest version because of my code.

2. In your eclipse, go to Window->preference->Java->Installed JREs.

From where you can find your current version& its path. Do ‘Add’ add the newest installed JDK <> . If you are using window, the default installation path is <C:\Program Files\Java\jdk1.7.0_17>. Check this version for your project.




June 12, 2012 Leave a comment

Here’s the wonderful imageJ <;

Sometimes, one can really learning something by just reading these fundamental algorithmes.

And here’s a version of mean-shift.  And  a sklearn python version.

Here’s a nice comparison of different clustering method.

Categories: Image Processing, Java

Manual Eclipse weka project creation

July 18, 2011 Leave a comment
  1. Setting up your Eclipse project.
    1. Run Eclipse and choose File, New, Project, Java Project.
    2. Name it whatever you want and set the different options according to your own preferences. (For example, I prefer to keep my source files in a sub directory src and the compiled bytecode class files in a sub directory build.)
    3. Under the Libraries tab, choose Add External Jars and add weka.jar from the directory where you installed WEKA.
    4. Click finish. This will create a new project in the Package Explorer.
  2. Setup WEKA source and Javadoc pointers. (Optional)
    1. Expand your project in the Package Explorer, right-click on weka.jar, and choose Properties....
    2. Under Javadoc location, choose javadoc url and Browse for $WEKA$/doc, where $WEKA$ is the directory where you installed WEKA.
    3. Under Java Source Attachment, choose External File... and select $WEKA$/weka-src.jar.

Here are some examples for using weka inside your java code.

Another simple way when you want to add the jar file into your current project:
Setup and Configuration
1) Downloaded and Weka.jar extracted into a folder.
2) Create a new project
3) Navigate to “Build Path” -> “Add External Archives” and choose your weka-jar file

Other Links:
Creating a weka class
Some sample Codes using weka
– Nice Tutorial for Eclipse (Add the src and javadoc in Eclipse)

Categories: Java, Weka