I am trying to run k6 script for load testing .i am using Docker, k6 influxdb and grafana and using Cygwin to provide Linux environment. we I have already some java function so I am added a new module into k6 and docker build but when I am run it through a script I am getting an error like
command: fork/exec C:/Program Files/Java/jdk1.8.0_131/bin/java: no such file or directory
we use the following code in go language to run a java file
package helloindia
import (
“fmt”
“os/exec”
)
type HELLOINDIA struct{
Name string
Key string}
func (h *HELLOINDIA) display() {
fmt.Println(“hello world”)
h.Name = "Saurabh"
say, err := command(“viney”)
if err != nil {
fmt.Println("command: ", err)
return
}
fmt.Println(say)
h.Key = say
}
func command(name string) (string, error) {
out, err := exec.Command(“C:/Program Files/Java/jdk1.8.0_131/bin/java”, “GenerateOtpValue”).Output()
if err != nil {
return “”, err
}
return string(out), nil
}
const writeWait = 10
func New() *HELLOINDIA {
h := new(HELLOINDIA)
h.Name = “Srivastava”