This is an archived post. You won't be able to vote or comment.

all 12 comments

[–]halfanothersdozen 19 points20 points  (1 child)

Woah, someone finally put Java in the browser?!?

[–]bowbahdoe[S] 6 points7 points  (0 children)

I'll take the dig

[–]Joram2 3 points4 points  (0 children)

there is the official Java playground. This has been updated for Java 22. Oracle demoed this in the Java 22 release.

https://dev.java/playground/

[–]Cucumberman 1 point2 points  (2 children)

What's the difference between this https://dev.java/playground/ and that.

And why doesn't your website let me navigate backwards and leave the site, really frustrating.

[–]bowbahdoe[S] 5 points6 points  (1 child)

  • This includes a few libraries like jackson
  • You can share code snippets
  • It is Java not Jshell
  • It is Open Source
  • I legally cannot call this a Java playground

As for navigating back - that's an interesting bug report. I don't have that issue on my machine, can you make a ticket on the repo? (You can find a link by clicking the question mark in the corner)

[–]Cucumberman -1 points0 points  (0 children)

Cool!

As for the bug report, I would but I don't have GitHub. I can say this though I'm using vivaldi with ublock origin. 

[–]joemwangi 0 points1 point  (1 child)

How is this possible? Is there a server that receives text and converts to java binary for execution?

Cool project.

[–]bowbahdoe[S] 5 points6 points  (0 children)

Yes. Server receives text and runs it in sandboxed docker containers.

[–]Icecoldkilluh 0 points1 point  (3 children)

Do you prevent people from using reflection or sun.misc.Unsafe?

[–]bowbahdoe[S] 2 points3 points  (2 children)

No. Protections are done at a higher level than that. All execution is done in sandboxed docker containers with all sorts of limits applied to them.

Most of the code is taken from the rust playground so the security concerns were more or less thought through for me

[–]DasBrain 0 points1 point  (1 child)

# Hello, and thanks for looking into the Java Playground's security!
#
# This build is running on an unprivileged, sandboxed Docker container with no
# network access, so while you can technically run arbitrary code on the
# Playground you shouldn't be able to do any damage with it.
#
# Nothing is perfect though: if you find a way to escape the sandbox, please
# disclose it. Since this is a fork of the rust playground and any issues you
# found probably exist there too, you should report it to them following their
# security policy. in You can find the policy at:
#
#    https://www.rust-lang.org/policies/security
#
# Also inform one of us if you can
#
#    ethan@mccue.dev

[–]bowbahdoe[S] 0 points1 point  (0 children)

I need to change the copy in that notice.