Skip to content
Advertisement

I was able to compile my java code from PowerShell, but cannot run it

I was able to compile and run my java code from CMD, however when I try to run the same commands in PS, I am getting error messages. I have read and been told that CMD commands will work in PS, but the CMD commands are not working in PS

Here is the line that I am using to execute my program:

JavaScript

I am running the command from the directory where my needed JAR files are located. The error message says…

JavaScript

Made the change and the code looks like this now.

JavaScript

Still getting the exact same error message. I have also tried going up a directory and no luck. I have looked all over StackOverflow and I have done my research.

Any help would be much appreciated. Thanks.

Advertisement

Answer

Using . would work for one file, but since you have a number of files, you should reference the current directory in each one of those files.

JavaScript

Java 6 also supports wildcards, as this answer indicates, so you might try simply this.

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement