I trying to call a a java application from powershell but I am not exactly sure how to do this.
to keep it simple. I have a a java file called HelloWorld.java that looks like the following'
public class HelloWorld
{
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
Now assume I have compiled this code and I now have a file called HellowWorld.class
I can run this application from a bat file called HelloWorld.bat and it runs just fine. the HelloWorld.bat file has one line
"C:\Program Files\Java\jdk1.8.0_191"\bin\java.exe -cp ; HelloWorld
I am not 100% sure how I would call this java application directly from powershell. Now, before someone says just use
& HelloWorld.bat
Note that the above is an example. The java app that I want to call has parameters and the powershell app will be processing data to determine what parameter values to pass to the java script.
I have tried a number of things but no success. Any help would be appreciated.