Re: Help please!
fnl <[email protected]> Wed, 7 Aug 2024 08:09:32 -0700 (PDT)
| Newsgroups | gmane.comp.java.robocode |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_152584_1557726066.1723043372157 Content-Type: multipart/alternative; boundary="----=_Part_152585_1965980141.1723043372157" ------=_Part_152585_1965980141.1723043372157 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Please make sure you use the newest version of Robocode 1.9.5.2=20 <https://sourceforge.net/projects/robocode/files/robocode/1.9.5.2/>, as it= =20 contains a fix in set_java_options.sh/bat file run from robocode.sh/bat=20 file that fixes this error, when you use Java 11 or newer: @rem Only set 'java.security.manager=3Dallow' for Java version > 11 if %JAVA_MAJOR_VERSION% GTR 11 set _JAVA_OPTIONS=3D "-Djava.security.manager=3Dallow" Also make sure that you run Robocode by running the robocode.bat/sh file to= =20 ensure all Java options are setup correctly for both your system, and the= =20 specific Java version being used for running Robocode. If you set the Java options yourself in IntelliJ, then add the =20 -Djava.security.manager=3Dallow in the the Java options of the launcher=20 settings. Make sure Robocode itself is running on at least Java 11. You can check=20 this from the About box, which writes which Java version it run on. If a robot will not run, then check the bot console by clicking its button= =20 on the right side of the battle view to see if error messages are printed= =20 out. If Robocode is running on an older Java version than the Java version= =20 used for compiling the bot, you will probably see an error in the console= =20 for the bot. Write again, if you still got issues. onsdag den 7. august 2024 kl. 16.55.24 UTC+2 skrev [email protected]: > I've recompiled using Java 11 as you mentioned.Now the robot is shown wit= h=20 > the package name in the robot list.But after selecting it,when I start th= e=20 > battle,my robot is not shown in game. > > On Wednesday, August 7, 2024 at 12:54:58=E2=80=AFAM UTC+6 fnl wrote: > >> It is a very cryptic message at first. It seems that the robot your are= =20 >> trying to run has been compiled with Java class file version 65=20 >> <https://stackoverflow.com/questions/9170832/list-of-java-class-file-for= mat-major-version-numbers> which=20 >> means *Java 21*. >> But you are running the Robot on a Java version, the supports up to Java= =20 >> class file version 52=20 >> <https://stackoverflow.com/questions/9170832/list-of-java-class-file-for= mat-major-version-numbers>=20 >> which means up to *Java 8* (aka Java 1.8) >> >> In short this means that you are probably running Robocode with Java 8= =20 >> from inside IntelliJ, which does not support Java 21, which is many=20 >> versions newer. >> I recommend that you switch to a newer JDK (Java Developer Kit), which= =20 >> should be *version 21* as minimum for running your robot. >> You do this in IntelliJ from the menu: File -> Project Structure... ->= =20 >> Platform Settings / SDKs. Then you should "Add New SDK" by pressing the= =20 >> plus (+) symbol and select *Download SDK* and select version 21 (or=20 >> newer) and choose e.g. Oracle OpenJDK 21, or alternatively *Add SDK* if= =20 >> you already have Java 21 or never installed somewhere on your system. >> >> Alternatively, you can recompile your robot using an older Java version,= =20 >> e.g. Java 11, which is the minimum requirement for running the newest=20 >> Robocode version. >> >> I hope this helps? =F0=9F=99=82 >> tirsdag den 6. august 2024 kl. 20.37.25 UTC+2 skrev [email protected]= : >> >>> [image: Capture1.PNG] >>> I've made my 1st robot in IntelliJ idea but when I open robocode, this= =20 >>> error message is shown. How to fix it? >> >> --=20 You received this message because you are subscribed to the Google Groups "= Robocode" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/= robocode/83f4c5e2-fdc4-4e6c-85da-b5af0df7ddb1n%40googlegroups.com. ------=_Part_152585_1965980141.1723043372157 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Please make sure you use the newest version of Robocode<a href=3D"https://s= ourceforge.net/projects/robocode/files/robocode/1.9.5.2/"> 1.9.5.2</a>, as = it contains a fix in set_java_options.sh/bat file run from robocode.sh/bat = file that fixes this error, when you use Java 11 or newer:<br /><br /><div = style=3D"color: rgb(204, 204, 204); background-color: rgb(31, 31, 31); font= -family: Consolas, "Courier New", monospace; line-height: 19px; w= hite-space: pre;"><div><span style=3D"color: rgb(212, 212, 212);">@</span><= span style=3D"color: rgb(86, 156, 214);">rem</span><span style=3D"color: rg= b(106, 153, 85);"> Only set 'java.security.manager=3Dallow' for Java versio= n </span><span style=3D"color: rgb(244, 71, 71);">></span><span style=3D= "color: rgb(106, 153, 85);"> 11</span></div><div><span style=3D"color: rgb(= 197, 134, 192);">if</span> <span style=3D"color: rgb(156, 220, 254);">%JAVA= _MAJOR_VERSION%</span> <span style=3D"color: rgb(212, 212, 212);">GTR</span= > <span style=3D"color: rgb(181, 206, 168);">11</span> <span style=3D"color= : rgb(86, 156, 214);">set</span> <span style=3D"color: rgb(156, 220, 254);"= >_JAVA_OPTIONS</span><span style=3D"color: rgb(212, 212, 212);">=3D</span><= span style=3D"color: rgb(206, 145, 120);">"-Djava.security.manager=3Dallow"= </span></div></div><br />Also make sure that you run Robocode by running th= e robocode.bat/sh file to ensure all Java options are setup correctly for b= oth your system, and the specific Java version being used for running Roboc= ode.<br />If you set the Java options yourself in IntelliJ, then add the=C2= =A0 <span style=3D"color: rgb(206, 145, 120); font-family: Consolas, "Cour= ier New", monospace; white-space: pre; background-color: rgb(31, 31, 3= 1);">-Djava.security.manager=3Dallow</span>=C2=A0=C2=A0in the the Java opti= ons of the launcher settings.<br /><br />Make sure Robocode itself is runni= ng on at least Java 11. You can check this from the About box, which writes= which Java version it run on.<br /><br />If a robot will not run, then che= ck the bot console by clicking its button on the right side of the battle v= iew to see if error messages are printed out. If Robocode is running on an = older Java version than the Java version used for compiling the bot, you wi= ll probably see an error in the console for the bot.<br /><br />Write again= , if you still got issues.<br /><br /><div class=3D"gmail_quote"><div dir= =3D"auto" class=3D"gmail_attr">onsdag den 7. august 2024 kl. 16.55.24 UTC+2= skrev [email protected]:<br/></div><blockquote class=3D"gmail_quote" st= yle=3D"margin: 0 0 0 0.8ex; border-left: 1px solid rgb(204, 204, 204); padd= ing-left: 1ex;">I've recompiled using Java 11 as you mentioned.Now the = robot is shown with the package name in the robot list.But after selecting = it,when I start the battle,my robot is not shown in game.<br><br><div class= =3D"gmail_quote"></div><div class=3D"gmail_quote"><div dir=3D"auto" class= =3D"gmail_attr">On Wednesday, August 7, 2024 at 12:54:58=E2=80=AFAM UTC+6 f= nl wrote:<br></div></div><div class=3D"gmail_quote"><blockquote class=3D"gm= ail_quote" style=3D"margin:0 0 0 0.8ex;border-left:1px solid rgb(204,204,20= 4);padding-left:1ex">It is a very cryptic message at first. It seems that t= he robot your are trying to run has been compiled with <a href=3D"https://s= tackoverflow.com/questions/9170832/list-of-java-class-file-format-major-ver= sion-numbers" rel=3D"nofollow" target=3D"_blank" data-saferedirecturl=3D"ht= tps://www.google.com/url?hl=3Dda&q=3Dhttps://stackoverflow.com/question= s/9170832/list-of-java-class-file-format-major-version-numbers&source= =3Dgmail&ust=3D1723128937289000&usg=3DAOvVaw2NkkkxrG69DNz6GlRRGYGz"= >Java class file version 65</a>=C2=A0which means <b>Java 21</b>.<div>But yo= u are running the Robot on a Java version, the supports up to <a href=3D"ht= tps://stackoverflow.com/questions/9170832/list-of-java-class-file-format-ma= jor-version-numbers" rel=3D"nofollow" target=3D"_blank" data-saferedirectur= l=3D"https://www.google.com/url?hl=3Dda&q=3Dhttps://stackoverflow.com/q= uestions/9170832/list-of-java-class-file-format-major-version-numbers&s= ource=3Dgmail&ust=3D1723128937289000&usg=3DAOvVaw2NkkkxrG69DNz6GlRR= GYGz">Java class file version 52</a> which means up to <b>Java 8</b> (aka J= ava 1.8)<br><br></div><div>In short this means that you are probably runnin= g Robocode with Java 8 from inside IntelliJ, which does not support Java 21= , which is many versions newer.<br>I recommend that you switch to a newer J= DK (Java Developer Kit), which should be <b>version 21</b> as minimum for r= unning your robot.<br>You do this in IntelliJ from the menu: File -> Pro= ject Structure... -> Platform Settings / SDKs. Then you should "Add= New SDK" by pressing the plus (+) symbol and select <b>Download SDK</= b> and select version 21 (or newer) and choose e.g. Oracle OpenJDK 21, or a= lternatively <b>Add SDK</b>=C2=A0if you already have Java 21 or never insta= lled somewhere on your system.<br><br>Alternatively, you can recompile your= robot using an older Java version, e.g. Java 11, which is the minimum requ= irement for running the newest Robocode version.<br><br>I hope this helps? = =F0=9F=99=82</div><div class=3D"gmail_quote"><div dir=3D"auto" class=3D"gma= il_attr">tirsdag den 6. august 2024 kl. 20.37.25 UTC+2 skrev <a rel=3D"nofo= llow">[email protected]</a>:<br></div><blockquote class=3D"gmail_quote" = style=3D"margin:0 0 0 0.8ex;border-left:1px solid rgb(204,204,204);padding-= left:1ex"><img alt=3D"Capture1.PNG" width=3D"550px" height=3D"13px" src=3D"= https://groups.google.com/group/robocode/attach/3b7ab209c7115/Capture1.PNG?= part=3D0.1&view=3D1"><br>I've made my 1st robot in IntelliJ idea bu= t when I open robocode, this error message is shown. How to fix it?</blockq= uote></div></blockquote></div></blockquote></div> <p></p> -- <br /> You received this message because you are subscribed to the Google Groups &= quot;Robocode" group.<br /> To unsubscribe from this group and stop receiving emails from it, send an e= mail to <a href=3D"mailto:[email protected]">robocode+u= [email protected]</a>.<br /> To view this discussion on the web visit <a href=3D"https://groups.google.c= om/d/msgid/robocode/83f4c5e2-fdc4-4e6c-85da-b5af0df7ddb1n%40googlegroups.co= m?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid= /robocode/83f4c5e2-fdc4-4e6c-85da-b5af0df7ddb1n%40googlegroups.com</a>.<br = /> ------=_Part_152585_1965980141.1723043372157-- ------=_Part_152584_1557726066.1723043372157--