Join The Fan Lab, a private Fandom research community for users in the US and UK where you will be asked to share your opinions on all things gaming and entertainment! Click here to see if you qualify

Known Issues and Workarounds/Fix for Java 7 with Linux 64

From Towns Wiki
Jump to: navigation, search

The following is a script that may be included in versions beyond 0.39.2 and was created to deal with Java 7 on Linux 64, and a keyboard issue. Only use it if you know what you're doing.

 liberror=" wrong ELF class: ELFCLASS32"
 #FIX for some VM's other then METACITY
 #save old value before unsetting
 java -Djava.library.path=lib/native/ -Xms512M -Xmx512M -jar lib/xaos.jar 2> $elferror
 #Is the exit code not 0, and does our file contain the ELF class error?
 if [ "$?" -ne 0 ]; then
   is_this_ELFERROR=$(cat $elferror | grep "$liberror" | wc -l)
   if [ $is_this_ELFERROR -eq 1 ]; then
      if [ -d oldlib ]; then
         echo "Hi, sorry to bug you, but it still seems things dont work, despite trying my best."
         echo "I will restore your old lib directory now so you can try yourself."
         rm -rf lib
         mv oldlib lib
         echo "Done, good luck. Try checking our forums at"
         echo "Hit enter to close this window."
         read a
         exit 1
         echo "Hi,"
         echo "It appears you are trying to run Towns with Java 1.7 on 64 bit Linux."
         echo "Sadly, this does not work because of some lwjgl issues."
         echo ""
         echo "If you have an active internet connection I can try fix this for you."
         echo "Do you want me to try? (Y/N) [N]"
         read yesno
         if [ "$yesno" = "Y" ]; then
            echo "Ok trying to download the right libraries, one minute."
            if [ -f "lwjgl*.zip" ]; then
               rm lwjgl*.zip
             wget $lwjgl_download -O 2> /dev/null
            if [ $? -eq 0 ]; then
               echo "Moving old lib dir to oldlib"
               mv lib oldlib
               echo "Making new lib directory"
               mkdir lib
               echo "Copying stuff we need from oldlib to lib"
               cp oldlib/xaos.jar lib/
               cp oldlib/slick-util.jar lib/
               echo "Extracting the files we need from the new lwjgl"
               unzip -j lwjgl-2.8.2/jar/lwjgl.jar -d lib/
               unzip -j lwjgl-2.8.2/jar/lwjgl_util.jar -d lib/
               unzip -j lwjgl-2.8.2/native/linux/* -d lib/native/
               echo ""
               echo "ok try again! Hit any key to close this window and then start the game again!"
               read a
               echo "I am sorry, but downloading the correct files did not seem to work."   
               echo "Please see for more information"
               echo "on running Towns with Java 1.7 64bit or use Java 1.6"
               echo ""
               echo "Hit any key to close this window"
               read a
            echo "Ok, doing nothing."
            echo "Hit any key to close this window."
            read a
      #not elf error, ok lets print it and hope they can use this info then.
      echo "not an elf error"
      result=$(cat $elferror)
      echo $result
 #If there were XMODIFIERS, set them again
 if  [ ${#oldXMODIFIERS} -ge 1 ]; then
   echo "Setting XMODIFIERS to old value."
 #remove the output file that might contain an the ELF error from lwjgl
 if [ -f $elferror ]; then
   rm $elferror