java_jail icon indicating copy to clipboard operation
java_jail copied to clipboard

VMStartException when running the main method from InMemory

Open lindstrum opened this issue 7 years ago • 4 comments

I am getting the following error when running the main method from InMemory and inputting the text from test-input.txt.

image

I notice if I remove the highlighted line, I get output similar to the expected output, but it differs in the that there is an exception message as shown below.

image

I have tried changing the classpath manually in the program to a few things, but not much changes. I am not very experienced in programming, so this may be a small error I don't see.

lindstrum avatar Jun 17 '18 00:06 lindstrum

Hi Ethan,

I would be surprised if this would work if you try to run it interactively in Eclipse. I've only ever used it by command-line java and javac. Have you tried using that approach instead?

daveagp avatar Jun 17 '18 17:06 daveagp

When I try from the command prompt, I get the following

image

This exception that is generated I previously solved in eclipse by adding the line System.getProperties().put("java.home", "C:\Program Files\Java\jdk1.8.0_20\jre"); but this nor changing the JAVA_HOME variable seems to change anything.

lindstrum avatar Jun 18 '18 00:06 lindstrum

I also should mention that I've never tried running this on Windows.

Well, the latter screenshot seems more informative. Do you know what is the problematic null? Looking at the code, I guess it could be the result of ToolProvider.getSystemJavaCompiler()? If you can check whether that's the case, maybe there's some caveats online about running that method on Windows.

daveagp avatar Jun 18 '18 02:06 daveagp

What are the major different between pythontutor's java_jail and this version

malavancs avatar Feb 16 '19 13:02 malavancs