0

I am running ./test 8080 script to run Test.class java file from terminal in Idea

//this is test.sh file
#!/bin/bash  

# shellcheck disable=SC2068
java -classpath src/com/company Test $@

But I'm getting the following error Error: Could not find or load main class Test I am not a bash guy I'm a new here but I would be grateful to know where the problem is?

JohnPix
  • 1,595
  • 21
  • 44
  • Has nothing to do with bash. Just how you invoke java. And hint: .java files are source code. Unless you are using a single self contained class, and Java 11 ...then **you** have to first compile the source .java to a .class file. And sorry: there are no detours. You can't just use a new technology without studying its basics and then expect things to work. Any good tutorial or book about java starts by explaining the things to you ... you are struggling with right now. – GhostCat Nov 14 '19 at 19:57
  • See reason #2a in the duplicate’s accepted answer. – VGR Nov 14 '19 at 20:36

0 Answers0