Hi,
Im having a bizzare problem when I try and run a battle from Eclipse, I originally tried running it using the Robocode Engine - a direct copy of the tutorial - but that always gave the error
Can't find robocode.core-1.x.jar module near to robocode.jar
so I abandoned that. Instead I am now using a .bat file that reads
Which runs perfectly when I just run it by clicking it. But, when I try and call it from inside my java code it no longer accepts any robots that I've written in Eclipse and in the console says:
GotanerrorwithrobotEC.GA:java.lang.ClassNotFoundException:robotEC/GA:Unsupportedmajor.minorversion52.0GotanerrorwithrobotEC.GeneticToolbox:java.lang.ClassNotFoundException:robotEC/GeneticToolbox:Unsupportedmajor.minorversion52.0GotanerrorwithrobotEC.Genome:java.lang.ClassNotFoundException:robotEC/Genome:Unsupportedmajor.minorversion52.0GotanerrorwithrobotEC.Ribot:java.lang.ClassNotFoundException:robotEC/Ribot:Unsupportedmajor.minorversion52.0Gotanerrorwithrobots.AdvancedEnemyBot:java.lang.ClassNotFoundException:robots/AdvancedEnemyBot:Unsupportedmajor.minorversion52.0Gotanerrorwithrobots.EnemyBot:java.lang.ClassNotFoundException:robots/EnemyBot:Unsupportedmajor.minorversion52.0Can't load 'robotEC.Ribot*' because it is an invalid robot or team.
I have no idea whats happening. Any help would be appreciated,
thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The robots you try to run with Robocode has been compiled using Java 8 (which version 52.0 refers to - read more about it here).
But you are running Robocode on an older Java version, e.g. version 7 or perhaps version 6. You can open the About Box in Robocode to check what Java version Robocode is running on.
In order to fix this problem, you need to run Robocode using Java 8, or recompile the robots (if you have the sources) to an older Java version.
You should be able to fix the problem by simply installing JRE 8 (Java Runtime Environment) or the JDK 8 (Java Developer Kit) on your system. Then Robocode should use Java 8 an run the robots without any trouble. :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Oh.... when running a .bat file from within Eclipse, you need to specify which Java version that applies when running the batch file. Alternatively setup the project or whole workspace to use Java 8. :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Thanks for the reply, that was definitely the problem.
I do in fact already have the Java 8 JDK installed, with the workspace set to Java 8, And when Robocode is run independently it would run with Java 8. But for some reason when the .bat was run from Eclipse it would run Robocode with Java 7 ?!
Anyway, thanks for the help!
Much appreciated :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Im having a bizzare problem when I try and run a battle from Eclipse, I originally tried running it using the Robocode Engine - a direct copy of the tutorial - but that always gave the error
so I abandoned that. Instead I am now using a .bat file that reads
Which runs perfectly when I just run it by clicking it. But, when I try and call it from inside my java code it no longer accepts any robots that I've written in Eclipse and in the console says:
I have no idea whats happening. Any help would be appreciated,
thanks.
The robots you try to run with Robocode has been compiled using Java 8 (which version 52.0 refers to - read more about it here).
But you are running Robocode on an older Java version, e.g. version 7 or perhaps version 6. You can open the About Box in Robocode to check what Java version Robocode is running on.
In order to fix this problem, you need to run Robocode using Java 8, or recompile the robots (if you have the sources) to an older Java version.
You should be able to fix the problem by simply installing JRE 8 (Java Runtime Environment) or the JDK 8 (Java Developer Kit) on your system. Then Robocode should use Java 8 an run the robots without any trouble. :-)
Oh.... when running a .bat file from within Eclipse, you need to specify which Java version that applies when running the batch file. Alternatively setup the project or whole workspace to use Java 8. :-)
Hi,
Thanks for the reply, that was definitely the problem.
I do in fact already have the Java 8 JDK installed, with the workspace set to Java 8, And when Robocode is run independently it would run with Java 8. But for some reason when the .bat was run from Eclipse it would run Robocode with Java 7 ?!
Anyway, thanks for the help!
Much appreciated :)