From e03303addd55b748beee8c48791f33c62010e03a Mon Sep 17 00:00:00 2001 From: Christian Meier Date: Mon, 8 Jun 2015 12:22:38 +0200 Subject: [PATCH] handle -J-cp without errors on launch in same VM --- .../src/main/java/org/jruby/util/cli/ArgumentProcessor.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/jruby/util/cli/ArgumentProcessor.java b/core/src/main/java/org/jruby/util/cli/ArgumentProcessor.java index 948a3784586..31da8fcce7e 100644 --- a/core/src/main/java/org/jruby/util/cli/ArgumentProcessor.java +++ b/core/src/main/java/org/jruby/util/cli/ArgumentProcessor.java @@ -227,8 +227,12 @@ private void processArgument() { config.getLoadPaths().addAll(Arrays.asList(ls)); break FOR; case 'J': - grabOptionalValue(); + String js = grabOptionalValue(); config.getError().println("warning: " + argument + " argument ignored (launched in same VM?)"); + if (js.equals("-cp") || js.equals("-classpath")) { + for(;grabOptionalValue() != null;) {} + grabValue(getArgumentError(" -J-cp must be followed by a path expression")); + } break FOR; case 'K': // FIXME: No argument seems to work for -K in MRI plus this should not