Running a Java program that takes functions as parameters

A program I’ve written recently with Java takes three parameters; an integer and two functions. It runs great in Eclipse, but PowerShell seems to want to take the “f(x)” aspect of my input and run it through something in its own path, rather than passing it in to the program.

Here is the input/output:

PS C:UsersUserDesktop> java -jar .CostBenefitOptimizer.jar 10 f(x)=x^(1/2) f(x)=x^(2)/10 x : The term 'x' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:43 + java -jar .CostBenefitOptimizer.jar 10 f(x)=x^(1/2) f(x)=x^(2)/10 + ~ + CategoryInfo : ObjectNotFound: (x:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException 

How can I get PowerShell to pass those functions in as String parameters instead of trying to do something with them?

submitted by /u/LorenWard
[link] [comments]

Leave a Reply