title: Getting a java.nio.file.InvalidPathException: Illegal char <*> while trying to compile java files
body: <p>I am a beginner in Java. I started a tentative OOP project for which I am creating a bunch of different packages. Since my project is git tracked, I am trying to recompile everything before syncing. To simplify the process of compiling through my VS Code Powershell, I created a small windows batch script
  called <em>packageUpdater.bat</em> that deletes all previously compiled java packages and then should recompile all indexed java sources:</p>
  <pre><code>cd &quot;C:\path\to\project\folder&quot;
  del &quot;.\Confrontation\*&quot; &quot;.\Defines\*&quot; &quot;.\WorldBasics\*&quot;
  javac -d . &quot;.\sources\Defines\*.java&quot; &quot;.\sources\WorldBasics\*.java&quot; &quot;.\sources\Confrontation\*.java&quot;
  pause
  </code></pre>
  <p>I tried running <em>packageUpdater.bat</em> from the Powershell terminal but then ran into this error:</p>
  <blockquote>
  <p>C:\path\to\project\folder&gt;javac -d . &quot;.\sources\Confrontation*.java&quot;</p>
  </blockquote>
  <blockquote>
  <p>Exception in thread &quot;main&quot; java.nio.file.InvalidPathException: Illegal char &lt;*&gt; at index 18: .\sources\Defines*.java
  at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
  at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
  at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
  at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
  at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:229)
  at java.base/java.nio.file.Path.of(Path.java:147)
  at java.base/java.nio.file.Paths.get(Paths.java:69)
  at jdk.compiler/com.sun.tools.javac.main.Option$37.process(Option.java:693)
  at jdk.compiler/com.sun.tools.javac.main.Option.handleOption(Option.java:1088)
  at jdk.compiler/com.sun.tools.javac.main.Arguments.doProcessArgs(Arguments.java:381)
  at jdk.compiler/com.sun.tools.javac.main.Arguments.init(Arguments.java:193)
  at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:229)
  at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:170)
  at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57)
  at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43)</p>
  </blockquote>
  <p>The deletion part executes properly and I get to validate each delete ops. And I know the paths to the files are correct because when I run that same <strong>javac</strong> command in the Powershell directly, it runs without any issue. I am new to using batch files as well so I am wondering if I am doing something wrong. Can anyone help?</p>