Skip to main content

Fix Maven Command in Windows Returns a Java Hint

tip

Environment:

  • Windows Server 2012 R2
  • Apache Maven 3.6.0

When I run any maven command (whatever), I always get the following answer

Usage: java [-options] class [args...] (to execute a class) or java [-options] -jar jarfile [args...] (to execute a jar file)

Before removing C:.mvn folder

This happens if you have .mvn folder in the system volume (C:). Removing C:.mvn will fix this error.

After removing C:.mvn folder

References:

  1. I entered mvn command in windows, but the command line return a java hint
  2. Maven 3.0.4 error on Windows 8 x64