Re: Robocode crashing at intialization
fnl <[email protected]> Sat, 5 Nov 2022 02:06:30 -0700 (PDT)
| Newsgroups | gmane.comp.java.robocode |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_7758_1260060337.1667639190714
Content-Type: multipart/alternative;
boundary="----=_Part_7759_1225703626.1667639190714"
------=_Part_7759_1225703626.1667639190714
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Hello everybody,
Newer versions of Robocode has issues with running with Java 12 or newer=20
unless this option is being used: -Djava.security.manager=3Dallow
Robocode make use of the Security Manager in Java, which is now *deprecated=
=20
for removal*. Hence, setting the java.security.manager to allow will make=
=20
sure the Security Manager can still be used.
At least until it will be completely removed from Java. Unfortunately, it=
=20
is not simple to remove the security manager of Robocode, as it require a=
=20
redesign and refactoring of the core of the game.
The newest versions of Robocode comes with robocode.cmd for Windows,=20
robocode.sh for Linux/macOS, and robocode.command for older Macs. Within=20
these files, there is two sets of command lines for starting Robocode. One=
=20
of them is uncommented for older Java versions (prior to Java 12). So=20
please remove the '#' mark from the first line with java -Xmx512M if you=20
are using an old version of and Java, and comment out the other one.
pwd=3D`pwd`
cd "${0%/*}"
# Older than Java 12
# java -Xmx512M -cp "libs/*" -XX:+IgnoreUnrecognizedVMOptions=20
"--add-opens=3Djava.base/sun.net.www.protocol.jar=3DALL-UNNAMED"=20
"--add-opens=3Djava.base/java.lang.reflect=3DALL-UNNAMED"=20
"--add-opens=3Djava.desktop/javax.swing.text=3DALL-UNNAMED"=20
"--add-opens=3Djava.desktop/sun.awt=3DALL-UNNAMED" robocode.Robocode $*
# Java 12 and newer
java -Xmx512M -cp "libs/*" -Djava.security.manager=3Dallow=20
-XX:+IgnoreUnrecognizedVMOptions=20
"--add-opens=3Djava.base/sun.net.www.protocol.jar=3DALL-UNNAMED"=20
"--add-opens=3Djava.base/java.lang.reflect=3DALL-UNNAMED"=20
"--add-opens=3Djava.desktop/javax.swing.text=3DALL-UNNAMED"=20
"--add-opens=3Djava.desktop/sun.awt=3DALL-UNNAMED" robocode.Robocode $*
cd "${pwd}"
l=C3=B8rdag den 5. november 2022 kl. 09.50.40 UTC+1 skrev [email protected]=
om:
> please i have this issue any solution ????
>
> On Thursday, October 6, 2022 at 6:21:24 AM UTC-7 fnl wrote:
>
>> Thank you for the follow-up. =F0=9F=99=82=F0=9F=91=8D
>> I will keep this in mind if we see this issue again, which is very=20
>> likely.
>>
>> Cheers,
>> - Flemming
>>
>> mandag den 3. oktober 2022 kl. 22.38.57 UTC+2 skrev [email protected]:
>>
>>> Hello Flemming,
>>>
>>> Just had the same issue now on Ubuntu20.04 using jdk-17.0.4.1+1 from=20
>>> https://adoptium.net/temurin/releases/ (amongst others). I am sill a=20
>>> bit confused between Gradle, Jetbrains and OS configuration of the JDKs=
,=20
>>> however I thinks that is what I configured. In the end to get the test=
=20
>>> (mostly) running I had to use the VM option=20
>>> "--add-opens=3Djava.base/java.util=3DALL-UNNAMED" as described in=20
>>> https://github.com/junit-pioneer/junit-pioneer/issues/509. Although=20
>>> this has nothing to do with robocode, that helped.
>>>
>>> BR
>>> Alessandro
>>> fnl schrieb am Dienstag, 5. April 2022 um 20:00:32 UTC+2:
>>>
>>>> It seems to be a problem with the Java version.
>>>> I have tested Robocode against Java 17 with Eclipse Adoptium (Temurin)=
=20
>>>> on Windows 11, where it seems to run.
>>>>
>>>> I suggest you try to use an older Java version when running Robocode,=
=20
>>>> e.g. version 11.
>>>>
>>>> Which version of Java are you running? You can find out by writting=20
>>>> this command from the command line:
>>>>
>>>> java -version
>>>>
>>>> Best regards,
>>>>
>>>> - Flemming
>>>> tirsdag den 5. april 2022 kl. 19.58.02 UTC+2 skrev John Davis:
>>>>
>>>>> Hi
>>>>> can anyone help me please? I'm trying to setup a basic robot in=20
>>>>> Robocode for a college assignment. I did a basic program in eclipse, =
and=20
>>>>> set Robocode to initialize from there. Robocode starts up and then cr=
ashes.=20
>>>>> Has anyone every seen this? Please Please Help....Thanks
>>>>>
>>>>> See the fault below from the console.....
>>>>>
>>>>> Loaded net.sf.robocode.api
>>>>> Loaded net.sf.robocode.core
>>>>> Loading plugins from C:\robocode\libs
>>>>> Loaded net.sf.robocode.battle
>>>>> Loaded net.sf.robocode.host
>>>>> Loaded net.sf.robocode.repository
>>>>> Loaded net.sf.robocode.sound
>>>>> Loaded net.sf.robocode.ui
>>>>> Loaded net.sf.robocode.ui.editor
>>>>> No robocode.properties. Using defaults.
>>>>> No robocode.properties. Using defaults.
>>>>> WARNING: A terminally deprecated method in java.lang.System has been=
=20
>>>>> called
>>>>> WARNING: System::setSecurityManager has been called by=20
>>>>> net.sf.robocode.host.security.RobocodeSecurityManager=20
>>>>> (file:/C:/robocode/libs/robocode.host-1.9.4.5.jar)
>>>>> WARNING: Please consider reporting this to the maintainers of=20
>>>>> net.sf.robocode.host.security.RobocodeSecurityManager
>>>>> WARNING: System::setSecurityManager will be removed in a future relea=
se
>>>>> java.lang.ExceptionInInitializerError
>>>>> at=20
>>>>> net.sf.robocode.repository.RepositoryManager.reload(RepositoryManager=
.java:164)
>>>>> at=20
>>>>> net.sf.robocode.ui.WindowManager.showSplashScreen(WindowManager.java:=
358)
>>>>> at net.sf.robocode.core.RobocodeMain.run(RobocodeMain.java:124)
>>>>> at java.base/java.lang.Thread.run(Thread.java:833)
>>>>> Caused by: java.lang.reflect.InaccessibleObjectException: Unable to=
=20
>>>>> make field private static final java.util.HashMap=20
>>>>> sun.net.www.protocol.jar.JarFileFactory.fileCache accessible: module=
=20
>>>>> java.base does not "opens sun.net.www.protocol.jar" to unnamed module=
=20
>>>>> @529abded
>>>>> at=20
>>>>> java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Ac=
cessibleObject.java:354)
>>>>> at=20
>>>>> java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Ac=
cessibleObject.java:297)
>>>>> at=20
>>>>> java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:17=
8)
>>>>> at java.base/java.lang.reflect.Field.setAccessible(Field.java:172=
)
>>>>> at=20
>>>>> net.sf.robocode.io.URLJarCollector.<clinit>(URLJarCollector.java:48)
>>>>> ... 4 more
>>>>>
>>>>> java.lang.ExceptionInInitializerError
>>>>> at=20
>>>>> net.sf.robocode.repository.RepositoryManager.reload(RepositoryManager=
.java:164)
>>>>> at=20
>>>>> net.sf.robocode.ui.WindowManager.showSplashScreen(WindowManager.java:=
358)
>>>>> at net.sf.robocode.core.RobocodeMain.run(RobocodeMain.java:124)
>>>>> at java.base/java.lang.Thread.run(Thread.java:833)
>>>>> Caused by: java.lang.reflect.InaccessibleObjectException: Unable to=
=20
>>>>> make field private static final java.util.HashMap=20
>>>>> sun.net.www.protocol.jar.JarFileFactory.fileCache accessible: module=
=20
>>>>> java.base does not "opens sun.net.www.protocol.jar" to unnamed module=
=20
>>>>> @529abded
>>>>> at=20
>>>>> java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Ac=
cessibleObject.java:354)
>>>>> at=20
>>>>> java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(Ac=
cessibleObject.java:297)
>>>>> at=20
>>>>> java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:17=
8)
>>>>> at java.base/java.lang.reflect.Field.setAccessible(Field.java:172=
)
>>>>> at=20
>>>>> net.sf.robocode.io.URLJarCollector.<clinit>(URLJarCollector.java:48)
>>>>> ... 4 more
>>>>>
>>>>>
--=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/69ea9b5d-431c-4e2c-95ae-441d3cad75can%40googlegroups.com.
------=_Part_7759_1225703626.1667639190714
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Hello everybody,<div><br></div><div>Newer versions of Robocode has issues w=
ith running with Java 12 or newer unless this option is being used:<font fa=
ce=3D"Courier New"> -Djava.security.manager=3Dallow</font><br>Robocode=
make use of the Security Manager in Java, which is now <i>deprecated =
for removal</i>. Hence, setting the <font face=3D"Courier New">java.se=
curity.manager</font> to <font face=3D"Courier New">allow </font>will =
make sure the Security Manager can still be used.<br>At least until it will=
be completely removed from Java. Unfortunately, it is not simple to remove=
the security manager of Robocode, as it require a redesign and refactoring=
of the core of the game.<br><br>The newest versions of Robocode comes with=
robocode.cmd for Windows, robocode.sh for Linux/macOS, and robocode.comman=
d for older Macs. Within these files, there is two sets of command lines fo=
r starting Robocode. One of them is uncommented for older Java versions (pr=
ior to Java 12). So please remove the '#' mark from the first line with&nbs=
p;<font face=3D"Courier New">java -Xmx512M</font> if you are using an old v=
ersion of and Java, and comment out the other one.<br><br>pwd=3D`pwd`=
<br>cd "<span style=3D"font-weight: bold;">$</span>{0%/*}"<br># Older than =
Java 12<br># java -Xmx512M -cp "libs/*" -XX:+IgnoreUnrecognizedVMOptions "-=
-add-opens=3Djava.base/sun.net.www.protocol.jar=3DALL-UNNAMED" "--add-opens=
=3Djava.base/java.lang.reflect=3DALL-UNNAMED" "--add-opens=3Djava.desktop/j=
avax.swing.text=3DALL-UNNAMED" "--add-opens=3Djava.desktop/sun.awt=3DALL-UN=
NAMED" robocode.Robocode $*<br><br># Java 12 and newer<br>java -Xmx512M -cp=
"libs/*" -Djava.security.manager=3Dallow -XX:+IgnoreUnrecognizedVMOptions =
"--add-opens=3Djava.base/sun.net.www.protocol.jar=3DALL-UNNAMED" "--add-ope=
ns=3Djava.base/java.lang.reflect=3DALL-UNNAMED" "--add-opens=3Djava.desktop=
/javax.swing.text=3DALL-UNNAMED" "--add-opens=3Djava.desktop/sun.awt=3DALL-=
UNNAMED" robocode.Robocode $*<br>cd "<span style=3D"font-weight: bold;">$</=
span>{pwd}"<br></div><br><div class=3D"gmail_quote"><div dir=3D"auto" class=
=3D"gmail_attr">l=C3=B8rdag den 5. november 2022 kl. 09.50.40 UTC+1 skrev h=
[email protected]:<br/></div><blockquote class=3D"gmail_quote" style=3D"ma=
rgin: 0 0 0 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left:=
1ex;">please i have this issue any solution ????<br><br><div class=3D"gmai=
l_quote"></div><div class=3D"gmail_quote"><div dir=3D"auto" class=3D"gmail_=
attr">On Thursday, October 6, 2022 at 6:21:24 AM UTC-7 fnl wrote:<br></div>=
</div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D=
"margin:0 0 0 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex=
">Thank you for the follow-up. =F0=9F=99=82=F0=9F=91=8D<div>=C2=A0I will ke=
ep this in mind if we see this issue again, which is very likely.</div><div=
><br></div><div>Cheers,<br></div><div>- Flemming</div><div><br></div><div c=
lass=3D"gmail_quote"><div dir=3D"auto" class=3D"gmail_attr">mandag den 3. o=
ktober 2022 kl. 22.38.57 UTC+2 skrev <a rel=3D"nofollow">[email protected]=
</a>:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 0.8e=
x;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Hello Flemm=
ing,</div><div><br></div><div>Just had the same issue now on Ubuntu20.04 us=
ing jdk-17.0.4.1+1 from <a href=3D"https://adoptium.net/temurin/releases/" =
rel=3D"nofollow" target=3D"_blank" data-saferedirecturl=3D"https://www.goog=
le.com/url?hl=3Dda&q=3Dhttps://adoptium.net/temurin/releases/&sourc=
e=3Dgmail&ust=3D1667725231958000&usg=3DAOvVaw3plcBZ7xre9iYfcJn-_Atq=
">https://adoptium.net/temurin/releases/</a> (amongst others). I am sill a =
bit confused between Gradle, Jetbrains and OS configuration of the JDKs, ho=
wever I thinks that is what I configured. In the end to get the test (mostl=
y) running I had to <span>use the VM option "--add-opens=3Djava.base/j=
ava.util=3DALL-UNNAMED" as described in <a href=3D"https://github.com/=
junit-pioneer/junit-pioneer/issues/509" rel=3D"nofollow" target=3D"_blank" =
data-saferedirecturl=3D"https://www.google.com/url?hl=3Dda&q=3Dhttps://=
github.com/junit-pioneer/junit-pioneer/issues/509&source=3Dgmail&us=
t=3D1667725231958000&usg=3DAOvVaw3kPCP7HFZw-VN4Kft-AHlC">https://github=
.com/junit-pioneer/junit-pioneer/issues/509</a>. Although this has nothing =
to do with robocode, that helped.<br></span></div><div><span><br></span></d=
iv><div><span>BR<br></span></div>Alessandro<br><div class=3D"gmail_quote"><=
div dir=3D"auto" class=3D"gmail_attr">fnl schrieb am Dienstag, 5. April 202=
2 um 20:00:32 UTC+2:<br></div><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0 0 0 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><=
p>It seems to be a problem with the Java version.<br>I have tested Robocode=
against Java 17 with Eclipse Adoptium=C2=A0(Temurin) on Windows 11, where =
it seems to run.</p><p>I suggest you try to use an older Java version when =
running Robocode, e.g. version 11.<br><br>Which version of Java are you run=
ning? You can find out by writting this command from the command line:</p><=
p>java -version</p><p>Best regards,</p><p>- Flemming</p><div class=3D"gmail=
_quote"><div dir=3D"auto" class=3D"gmail_attr">tirsdag den 5. april 2022 kl=
. 19.58.02 UTC+2 skrev John Davis:<br></div><blockquote class=3D"gmail_quot=
e" style=3D"margin:0 0 0 0.8ex;border-left:1px solid rgb(204,204,204);paddi=
ng-left:1ex"><div>Hi</div><div>can anyone help me please? I'm trying to=
setup a basic robot in Robocode for a college assignment. I did a basic pr=
ogram in eclipse, and set Robocode to initialize from there. Robocode start=
s up and then crashes. Has anyone every seen this? Please Please Help....Th=
anks</div><div><br></div><div>See the fault below from the console.....<br>=
</div><div><br></div>Loaded net.sf.robocode.api<br>Loaded net.sf.robocode.c=
ore<br>Loading plugins from C:\robocode\libs<br>Loaded net.sf.robocode.batt=
le<br>Loaded net.sf.robocode.host<br>Loaded net.sf.robocode.repository<br>L=
oaded net.sf.robocode.sound<br>Loaded net.sf.robocode.ui<br>Loaded net.sf.r=
obocode.ui.editor<br>No robocode.properties. Using defaults.<br>No robocode=
.properties. Using defaults.<br>WARNING: A terminally deprecated method in =
java.lang.System has been called<br>WARNING: System::setSecurityManager has=
been called by net.sf.robocode.host.security.RobocodeSecurityManager (file=
:/C:/robocode/libs/robocode.host-1.9.4.5.jar)<br>WARNING: Please consider r=
eporting this to the maintainers of net.sf.robocode.host.security.RobocodeS=
ecurityManager<br>WARNING: System::setSecurityManager will be removed in a =
future release<br>java.lang.ExceptionInInitializerError<br>=C2=A0 =C2=A0 at=
net.sf.robocode.repository.RepositoryManager.reload(RepositoryManager.java=
:164)<br>=C2=A0 =C2=A0 at net.sf.robocode.ui.WindowManager.showSplashScreen=
(WindowManager.java:358)<br>=C2=A0 =C2=A0 at net.sf.robocode.core.RobocodeM=
ain.run(RobocodeMain.java:124)<br>=C2=A0 =C2=A0 at java.base/java.lang.Thre=
ad.run(Thread.java:833)<br>Caused by: java.lang.reflect.InaccessibleObjectE=
xception: Unable to make field private static final java.util.HashMap sun.n=
et.www.protocol.jar.JarFileFactory.fileCache accessible: module java.base d=
oes not "opens sun.net.www.protocol.jar" to unnamed module @529ab=
ded<br>=C2=A0 =C2=A0 at java.base/java.lang.reflect.AccessibleObject.checkC=
anSetAccessible(AccessibleObject.java:354)<br>=C2=A0 =C2=A0 at java.base/ja=
va.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.jav=
a:297)<br>=C2=A0 =C2=A0 at java.base/java.lang.reflect.Field.checkCanSetAcc=
essible(Field.java:178)<br>=C2=A0 =C2=A0 at java.base/java.lang.reflect.Fie=
ld.setAccessible(Field.java:172)<br>=C2=A0 =C2=A0 at net.sf.robocode.io.URL=
JarCollector.<clinit>(URLJarCollector.java:48)<br>=C2=A0 =C2=A0 ... 4=
more<br><br>java.lang.ExceptionInInitializerError<br>=C2=A0 =C2=A0 at net.=
sf.robocode.repository.RepositoryManager.reload(RepositoryManager.java:164)=
<br>=C2=A0 =C2=A0 at net.sf.robocode.ui.WindowManager.showSplashScreen(Wind=
owManager.java:358)<br>=C2=A0 =C2=A0 at net.sf.robocode.core.RobocodeMain.r=
un(RobocodeMain.java:124)<br>=C2=A0 =C2=A0 at java.base/java.lang.Thread.ru=
n(Thread.java:833)<br>Caused by: java.lang.reflect.InaccessibleObjectExcept=
ion: Unable to make field private static final java.util.HashMap sun.net.ww=
w.protocol.jar.JarFileFactory.fileCache accessible: module java.base does n=
ot "opens sun.net.www.protocol.jar" to unnamed module @529abded<b=
r>=C2=A0 =C2=A0 at java.base/java.lang.reflect.AccessibleObject.checkCanSet=
Accessible(AccessibleObject.java:354)<br>=C2=A0 =C2=A0 at java.base/java.la=
ng.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297=
)<br>=C2=A0 =C2=A0 at java.base/java.lang.reflect.Field.checkCanSetAccessib=
le(Field.java:178)<br>=C2=A0 =C2=A0 at java.base/java.lang.reflect.Field.se=
tAccessible(Field.java:172)<br>=C2=A0 =C2=A0 at net.sf.robocode.io.URLJarCo=
llector.<clinit>(URLJarCollector.java:48)<br>=C2=A0 =C2=A0 ... 4 more=
<br><br></blockquote></div></blockquote></div></blockquote></div></blockquo=
te></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/69ea9b5d-431c-4e2c-95ae-441d3cad75can%40googlegroups.co=
m?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid=
/robocode/69ea9b5d-431c-4e2c-95ae-441d3cad75can%40googlegroups.com</a>.<br =
/>
------=_Part_7759_1225703626.1667639190714--
------=_Part_7758_1260060337.1667639190714--