Possible Duplicate:
Java command line arguments. Using * as an argument for multiplication
i just wanted to write a simple calculator.
If i enter 2 * 3 as parameters the array will look like this afterwards:
[2, .classpath, .project, .settings, bin, src, 3]
This happens for all our Eclipse installs in the company “Version: Indigo Service Release 2
Build id: 20120216-1857”
A friend of mine doesnt have this problem, so does anyone know the root of this problem?
greetings
Nico
The parameter
*gets replaced by the shell interpreter with the list of files in the current working directory. This typically happens on Linux/Unix platforms, but not (necessarily) on Windows. Does your friend use a Windows machine?In other words, this has nothing to do with Java, but with the shell command interpreter which interprets your command line prior to executing
java. To avoid it, you need to single-quote sensitive parameters, likejava MyApp 2 '*' 3.