New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-J options are erroneously passed as arguments to the program #5019
Comments
Imported From: https://issues.scala-lang.org/browse/SI-5019?orig=1 |
@paulp said: |
Chris Seaton (chrisseaton) said (edited on Sep 21, 2011 11:18:44 PM UTC):
I presume that the ClassNotFoundException is I am using Edit: I meant HelloWorld, not Test in command lines above. |
Chris Seaton (chrisseaton) said:
However, if I run
Then the |
@paulp said:
You'll have to supply evidence it's not something in your environment. There is a bug, which is that "scala HelloWorld -J-help" should be passing -J-help to HelloWorld rather than grabbing it for the JVM. |
Viacheslav Blinov (dant3) said: |
When I pass a
-Jfoo
argument to thescala
command, I would expectfoo
to be passed to the java command, and for-Jfoo
to not be included in the list of arguments passed to my main function, as they are explicitly for the Java runtime and not my program. However, any-J
arguments are included.This behaviour is due to https://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/compiler/scala/tools/ant/templates/tool-unix.tmpl#L129.
The problem really is that when you run a command such as
scala -Jfoo Bar
the Java command that is finally run is
java ... scala.tools.nsc.MainGenericRunner -Jfoo Bar
This means that
scala.tools.nsc.MainGenericRunner
tries to run the class-Jfoo
with the argumentBar
, and obviously fails to find the class.Also,
-J
isn't documented in the manual page. The related option-D
is documented.This is possibly related to #4907.
The text was updated successfully, but these errors were encountered: