Re: -DNOSECURITY=true

fnl <[email protected]> Thu, 11 May 2023 07:53:35 -0700 (PDT)
Newsgroups gmane.comp.java.robocode
Message-ID <[email protected]>
------=_Part_6758_664091779.1683816815017
Content-Type: multipart/alternative; 
	boundary="----=_Part_6759_495117986.1683816815017"

------=_Part_6759_495117986.1683816815017
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Okay. I think I found the problem. It is not possible to let Robocode add=
=20
the `robots` folder to the system classpath anymore programmatically since=
=20
Java 9.
However, we can still add it to the ordinary classpath when running=20
Robocode from the CLI. And we already did this previously with Robocode,=20
but removed it with the recent script changes.

So I have reintroduced putting the `robots` directory on the classpath for=
=20
all scripts used for running Robocode, RoboRumble etc.

Here is a new version "1.9.5.2" containing the new fix:
https://robocode.sourceforge.io/files/robocode-1.9.5.2-setup.jar

I cross my fingers that this works for you as well when adding the=20
`-DNOSECURITY=3Dtrue` option.

torsdag den 11. maj 2023 kl. 16.23.19 UTC+2 skrev fnl:

> Thank you for the heads up. I will have to come up with a better fix for=
=20
> this one.
> In the meantime, you'll need to stick with Java 8 when using the=20
> `-DNOSECURITY=3Dtrue` option, which is not optimal.
>
> torsdag den 11. maj 2023 kl. 06.36.56 UTC+2 skrev Gabriel Bonfim:
>
>> hey, thanks for the reply, i'll test this version and get back to you.
>>
>> att.
>>
>> Em qua., 10 de mai. de 2023 =C3=A0s 16:48, fnl <[email protected]>=
=20
>> escreveu:
>>
>>> Hi again,
>>>
>>> I made a fix that seems to work for me. This version has not been=20
>>> released yet, but it would be great to see if this version works for yo=
u?
>>>
>>> Robocode 1.9.5.2 with fix:
>>> https://robocode.sourceforge.io/files/robocode-1.9.5.2-setup.jar
>>>
>>> Best regards,
>>> - Flemming
>>>
>>> onsdag den 10. maj 2023 kl. 20.35.47 UTC+2 skrev fnl:
>>>
>>>> The lin to the issue described on Stack Overflow:
>>>>
>>>> https://stackoverflow.com/questions/63219405/exception-class-jdk-inter=
nal-loader-classloadersappclassloader-cannot-be-cast-t
>>>>
>>>> onsdag den 10. maj 2023 kl. 20.34.19 UTC+2 skrev fnl:
>>>>
>>>>> I am able to reproduce this using Java 11.=20
>>>>> It seems to work fine under Java 8. So you can use Java 8 as a=20
>>>>> workaround until I got a fix for it in Robocode as it seems to be a b=
ug.
>>>>>
>>>>> The issue is caused by some internal classes in Java that have=20
>>>>> changed, which Robocode accesses.=20
>>>>>
>>>>> On Stack Overflow, people have seen similar issues with Spring Boot a=
s=20
>>>>> well.
>>>>>
>>>>> Thank you for reporting this. I will try to fix it with the next=20
>>>>> version of Robocode. =F0=9F=99=82=F0=9F=91=8D
>>>>>
>>>>> Best regards,
>>>>> - Flemming N. Larsen
>>>>>
>>>>> tirsdag den 9. maj 2023 kl. 01.01.07 UTC+2 skrev Gabriel Bonfim:
>>>>>
>>>>>> Hey guys, i have a problem kk
>>>>>>
>>>>>> When i run robocode using -DNOSECURITY=3Dtrue , i have this error=20
>>>>>> message: "caused by: java.lang.classcastexception: class=20
>>>>>> jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to cl=
ass=20
>>>>>> java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLo=
ader=20
>>>>>> and java.net.URLClassLoader are in module java.base of loader 'boost=
rap').
>>>>>>
>>>>>> Help. pls=20
>>>>>>
>>>>> --=20
>>> You received this message because you are subscribed to a topic in the=
=20
>>> Google Groups "Robocode" group.
>>> To unsubscribe from this topic, visit=20
>>> https://groups.google.com/d/topic/robocode/4KZ0KgCxbvE/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to=20
>>> [email protected].
>>> To view this discussion on the web visit=20
>>> https://groups.google.com/d/msgid/robocode/23099408-8c36-4a6a-8aa7-372f=
870c44abn%40googlegroups.com=20
>>> <https://groups.google.com/d/msgid/robocode/23099408-8c36-4a6a-8aa7-372=
f870c44abn%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter>
>>> .
>>>
>>

--=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/66436a15-b500-4477-87bd-0d2842b89ec7n%40googlegroups.com.

------=_Part_6759_495117986.1683816815017
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Okay. I think I found the problem. It is not possible to let Robocode add t=
he `robots` folder to the system classpath anymore programmatically since J=
ava 9.<br />However, we can still add it to the ordinary classpath when run=
ning Robocode from the CLI. And we already did this previously with Robocod=
e, but removed it with the recent script changes.<br /><br />So I have rein=
troduced putting the `robots` directory on the classpath for all scripts us=
ed for running Robocode, RoboRumble etc.<br /><br />Here is a new version "=
1.9.5.2" containing the new fix:<br />https://robocode.sourceforge.io/files=
/robocode-1.9.5.2-setup.jar<br /><br />I cross my fingers that this works f=
or you as well when adding the `-DNOSECURITY=3Dtrue` option.<br /><br /><di=
v class=3D"gmail_quote"><div dir=3D"auto" class=3D"gmail_attr">torsdag den =
11. maj 2023 kl. 16.23.19 UTC+2 skrev fnl:<br/></div><blockquote class=3D"g=
mail_quote" style=3D"margin: 0 0 0 0.8ex; border-left: 1px solid rgb(204, 2=
04, 204); padding-left: 1ex;">Thank you for the heads up. I will have to co=
me up with a better fix for this one.<br>In the meantime, you&#39;ll need t=
o stick with Java 8 when using the `-DNOSECURITY=3Dtrue` option, which is n=
ot optimal.<br><br><div class=3D"gmail_quote"><div dir=3D"auto" class=3D"gm=
ail_attr">torsdag den 11. maj 2023 kl. 06.36.56 UTC+2 skrev Gabriel Bonfim:=
<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 0.8ex;bor=
der-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr">hey,=
 thanks for the reply, i&#39;ll test this version and get back to you.<br><=
div><br></div><div>att.</div></div><br><div class=3D"gmail_quote"></div><di=
v class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">Em qua., 10 d=
e mai. de 2023 =C3=A0s 16:48, fnl &lt;<a rel=3D"nofollow">flemming...@gmail=
.com</a>&gt; escreveu:<br></div></div><div class=3D"gmail_quote"><blockquot=
e class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px s=
olid rgb(204,204,204);padding-left:1ex">Hi again,<br><br>I made a fix that =
seems to work for me. This version has not been released yet, but it would =
be great to see if this version works for you?<br><br>Robocode 1.9.5.2 with=
 fix:<br><a href=3D"https://robocode.sourceforge.io/files/robocode-1.9.5.2-=
setup.jar" rel=3D"nofollow" target=3D"_blank" data-saferedirecturl=3D"https=
://www.google.com/url?hl=3Dda&amp;q=3Dhttps://robocode.sourceforge.io/files=
/robocode-1.9.5.2-setup.jar&amp;source=3Dgmail&amp;ust=3D1683902995237000&a=
mp;usg=3DAOvVaw08afaKKReahA5envBuhrvC">https://robocode.sourceforge.io/file=
s/robocode-1.9.5.2-setup.jar</a><br><br>Best regards,<div>- Flemming<br><br=
></div><div class=3D"gmail_quote"><div dir=3D"auto" class=3D"gmail_attr">on=
sdag den 10. maj 2023 kl. 20.35.47 UTC+2 skrev fnl:<br></div><blockquote cl=
ass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid=
 rgb(204,204,204);padding-left:1ex">The lin to the issue described on Stack=
 Overflow:<br><a href=3D"https://stackoverflow.com/questions/63219405/excep=
tion-class-jdk-internal-loader-classloadersappclassloader-cannot-be-cast-t"=
 rel=3D"nofollow" target=3D"_blank" data-saferedirecturl=3D"https://www.goo=
gle.com/url?hl=3Dda&amp;q=3Dhttps://stackoverflow.com/questions/63219405/ex=
ception-class-jdk-internal-loader-classloadersappclassloader-cannot-be-cast=
-t&amp;source=3Dgmail&amp;ust=3D1683902995237000&amp;usg=3DAOvVaw0sygtvmjJ6=
4o6f_h-8dxaC">https://stackoverflow.com/questions/63219405/exception-class-=
jdk-internal-loader-classloadersappclassloader-cannot-be-cast-t</a><br><br>=
<div class=3D"gmail_quote"><div dir=3D"auto" class=3D"gmail_attr">onsdag de=
n 10. maj 2023 kl. 20.34.19 UTC+2 skrev fnl:<br></div><blockquote class=3D"=
gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(20=
4,204,204);padding-left:1ex">I am able to reproduce this using Java 11.=C2=
=A0<div>It seems to work fine under Java 8. So you can use Java 8 as a work=
around until I got a fix for it in Robocode as it seems to be a bug.<br><br=
>The issue is caused by some internal classes in Java that have changed, wh=
ich Robocode accesses.=C2=A0</div><div><br></div><div>On Stack Overflow, pe=
ople have seen similar issues with Spring Boot as well.<br><br>Thank you fo=
r reporting this. I will try to fix it with the next version of Robocode. =
=F0=9F=99=82=F0=9F=91=8D</div><div><br></div><div>Best regards,</div><div>-=
 Flemming N. Larsen<br><br></div><div class=3D"gmail_quote"><div dir=3D"aut=
o" class=3D"gmail_attr">tirsdag den 9. maj 2023 kl. 01.01.07 UTC+2 skrev Ga=
briel Bonfim:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0p=
x 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">He=
y guys, i have a problem kk<div><br></div><div>When i run robocode using -D=
NOSECURITY=3Dtrue , i have this error message: &quot;caused by: java.lang.c=
lasscastexception: class jdk.internal.loader.ClassLoaders$AppClassLoader ca=
nnot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoa=
ders$AppClassLoader and java.net.URLClassLoader are in module java.base of =
loader &#39;boostrap&#39;).</div><div><br></div><div>Help. pls=C2=A0</div><=
/blockquote></div></blockquote></div></blockquote></div>

<p></p></blockquote></div><div class=3D"gmail_quote"><blockquote class=3D"g=
mail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204=
,204,204);padding-left:1ex">

-- <br>
You received this message because you are subscribed to a topic in the Goog=
le Groups &quot;Robocode&quot; group.<br>
To unsubscribe from this topic, visit <a href=3D"https://groups.google.com/=
d/topic/robocode/4KZ0KgCxbvE/unsubscribe" rel=3D"nofollow" target=3D"_blank=
" data-saferedirecturl=3D"https://www.google.com/url?hl=3Dda&amp;q=3Dhttps:=
//groups.google.com/d/topic/robocode/4KZ0KgCxbvE/unsubscribe&amp;source=3Dg=
mail&amp;ust=3D1683902995237000&amp;usg=3DAOvVaw3DO9NoqUg5gJXOw5hv49Mk">htt=
ps://groups.google.com/d/topic/robocode/4KZ0KgCxbvE/unsubscribe</a>.<br>
To unsubscribe from this group and all its topics, send an email to <a rel=
=3D"nofollow">[email protected]</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/d/msgid/robocode/23099408-8c36-4a6a-8aa7-372f870c44abn%40googlegroups.co=
m?utm_medium=3Demail&amp;utm_source=3Dfooter" rel=3D"nofollow" target=3D"_b=
lank" data-saferedirecturl=3D"https://www.google.com/url?hl=3Dda&amp;q=3Dht=
tps://groups.google.com/d/msgid/robocode/23099408-8c36-4a6a-8aa7-372f870c44=
abn%2540googlegroups.com?utm_medium%3Demail%26utm_source%3Dfooter&amp;sourc=
e=3Dgmail&amp;ust=3D1683902995237000&amp;usg=3DAOvVaw2u-I9PehdUtSxY23CabNek=
">https://groups.google.com/d/msgid/robocode/23099408-8c36-4a6a-8aa7-372f87=
0c44abn%40googlegroups.com</a>.<br>
</blockquote></div>
</blockquote></div></blockquote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;Robocode&quot; 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/66436a15-b500-4477-87bd-0d2842b89ec7n%40googlegroups.co=
m?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid=
/robocode/66436a15-b500-4477-87bd-0d2842b89ec7n%40googlegroups.com</a>.<br =
/>

------=_Part_6759_495117986.1683816815017--

------=_Part_6758_664091779.1683816815017--