Hello,
Im new to Drupal, and to website programming in general, so sorry if this is trivial. Im blocked since some days on this.
Im trying to run the recommender. Using Windows for now. Im still working under local server, so my recommender server is the same as my drupal server.
I modified the run.bat file given in example; I had to install JAVA too. I intially installed the last available JAVA version 1.6, but had an error message on my .bat saying version 1.5 was needed. So I installed JAVA 1.5 22 (J2SE Runtime Environment 5.0 Update 22). Now I have the error message below:
"Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file".
Is this because I need to install another version of JAVA 5.0, like before the 22 update? Im not sure what to do.
run.bat code and entire command display below.
Thanks!

.PHP 5.3.5 (cli) (built: Jan 6 2011 17:54:09)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
Press any key to continue . . .
Press any key to continue . . .
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version n
umber in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Press any key to continue . . .

@ echo off
@ rem If you install the module under 'sites\all\modules\recommeder' and 'sites\default\settings.php' is accessible, then you can run this script directly.
@ rem Otherwise, please see README and make necessary configuration to make this script running correctly.

SET DRUPAL_HOME=c:\xampp\htdocs\drupal02

SET ASYNC_COMMAND_HOME=%DRUPAL_HOME%\sites\all\modules\async_command
SET RECOMMENDER_HOME=%DRUPAL_HOME%\sites\all\modules\recommender
@ rem MAHOUT_HOME=%DRUPAL_HOME%\sites\all\libraries\mahout
SET MAHOUT_HOME=%DRUPAL_HOME%\sites\all\libraries\mahout
SET PATH=c:\xampp\php\

@ rem Test if the required programs (java and php) exist or not.
java -version 2>NUL || (echo Please install Java or put java.exe under PATH & pause & GOTO :END)
php -v 2>NUL || (echo Please install PHP or put php.exe under PATH & pause & GOTO :END)

pause

@ rem Set classpath for the java program.
set CLASSPATH=%RECOMMENDER_HOME%\recommender.jar;$ASYNC_COMMAND_HOME\drupal-app.jar;%ASYNC_COMMAND_HOME%\lib\*;%MAHOUT_HOME%\*

pause

@ rem Run recommender
java -cp %CLASSPATH% org.drupal.project.recommender.RecommenderApp

pause

@ rem Set the path of config.properties if you would use it.
@ rem SET CONFIG_FILE=c:\config.properties
SET CONFIG_FILE=%RECOMMENDER_HOME%\config.properties
@ rem java -cp %CLASSPATH% org.drupal.project.recommender.RecommenderApp -c %CONFIG_FILE%

pause

:END

Comments

Leoo’s picture

Assigned: Leoo » Unassigned
danithaca’s picture

Title: run.bat under windows; JAVA version » run.bat under windows; specify JAVA version
Assigned: Unassigned » danithaca

Sorry if this causes any confusion. You need Java 1.6+ (or Java SE 6+). I'll update it in the documentation.
Basically you can type "java -version" to check your current version.

danithaca’s picture

Version: 7.x-4.0-alpha6 » 7.x-4.x-dev
Status: Active » Fixed

Ok. Java version requirement is updated in the document. And the code will check the version too.
The changes will be available in the next release.

Leoo’s picture

Actually all good with the latest JAVA version yes, thx.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.