0

In the Jenkins 'Add build step' -> 'Execute Windows batch command' I am trying to compile and run my Java program.

cd D:\eclipse-workspace-ghj2\ExecJava_CustomDirectory_1\src javac pkg/Manager_1.java java pkg/Manager_1

But in command prompt it works. When I execute in Jenkins I get the following Errors.

C:\ProgramData\Jenkins.jenkins\workspace\ExecJava_CustomDirectory_1>javac pkg/Manager_1.java javac: file not found: pkg\Manager_1.java Usage: javac use -help for a list of possible options

C:\ProgramData\Jenkins.jenkins\workspace\ExecJava_CustomDirectory_1>java pkg/Manager_1 Error: Could not find or load main class pkg.Manager_1

TestSQA
  • 26
  • 3
  • 1
    *javac pkg/Manager_1.java* Because your source file isn't there. It's at `javac src\pkg\Manager_1.java`. And, as we said earlier, it's better to put the compiled class file in a different directory, out of your *source* tree – g00se Jun 02 '23 at 15:55

0 Answers0