1

Is this possible to have multiple JShell instances in a single JVM whilst keeping them independent? Like each instance having separate classpath/class definitions even if their names are the same? I want to create multiple REPLs but avoid creating a separate JVM for each one.

REPL user must be able to define types without interfering with other JShell instances.

Is it possible? Is it out of the box? What to do to achieve it?

Marcin
  • 4,080
  • 1
  • 27
  • 54
  • Even if it would be possible (what I somehow doubt), I dont think it is worth the effort. You would be doing something that nobody else does, and such things often turn into never ending up hill battles. – GhostCat Sep 18 '18 at 08:38
  • What would be your approach to serving 1000 REPLs simultaneously? What would be the most resource-efficient approach? The goal is to enable people to interact with JVM for educational purposes via www. – Marcin Sep 18 '18 at 08:45
  • To not do that via web ;-) ... I am pretty sure: 1000 REPL users on the same JVM wont fly either. Even when you tell them a million times, every 5th will at some point do `System.exit(0)`... or maybe crash the JVM using some other way. Then all your other users are thrown out, too. Honestly, this sounds like a really bad idea, and it doesn't get better ;-) – GhostCat Sep 18 '18 at 08:53
  • 3
    I would think about completely different solutions. Such as providing docker containers. Yes, that is a bit more work, but then your students just download the container once, and use it locally. You are still in control of the overall setup, but you avoid your students getting onto each other. – GhostCat Sep 18 '18 at 08:56

0 Answers0