0

Original directory structure

enter image description here

Compile the java ,and the shell make.sh

mkdir -p target
javac -sourcepath ./src/ ./src/com/tencent/Example.java  -d ./target/

and Two folders named target appeared.One of them has compiled files and the other is empty

enter image description here

Then execute another shell start.sh

cd target
echo "shell parameters: $*"
java -classpath . com.tencent.Example  $*

enter image description here the compiled file cannot be found.If I copy the compiled files in a target to an another empty folder.The program can be executed normally. I want to know why a folder with the same name is generated and how to solve this problem.

asd21d32a
  • 59
  • 4
  • 2
    Post text, not screenshots. For all you or we know there could be a space on the end of one name or the other, or a lookalike Unicode character. – Charles Duffy Dec 22 '21 at 03:26
  • 1
    Once you're on the command line you can do things like `printf '%q\n' *` to write your file names in unambiguous form. When you use GUI tools you don't have control to see beyond the fonts those tools render with. – Charles Duffy Dec 22 '21 at 03:27
  • 1
    I suspect you may have a `$'target\r'`, in particular -- meaning a directory name with a carriage return at the end. That would happen if you ran your script saved with a Windows text editor instead of a UNIX one, for example. – Charles Duffy Dec 22 '21 at 03:28
  • thank you very much.The cause of the problem is the encoding.Converting dos encoding to unix encoding can solve the problem – asd21d32a Dec 22 '21 at 08:51

0 Answers0