0

I'm trying to install java. It looks that java is installed correctly, but when type java in cmd get this error. Could someone advise what this means?

    C:\Users\Kamil>java Usage: java [options] [args...]   
    (to execute a class) or java [options] -jar [args...] (to execute a jar 
    file) or java [options] -m [/] [args...] java [options] --module [/] 
    [args...] (t`enter code here`o execute the main class in a module)
    Arguments following the main class, -jar , -m or --module / are passed as 
    the arguments to main class.
    where options include:
-d32          Deprecated, will be removed in a future release
-d64          Deprecated, will be removed in a future release
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
--class-path <class search path of directories and zip/jar files>
              A ; separated list of directories, JAR archives,
              and ZIP archives to search for class files.
              <module name> can also be ALL-DEFAULT, ALL-SYSTEM,
              ALL-MODULE-PATH.
--list-modules
              list observable modules and exit
-d <module name>
--describe-module <module name>
              describe a module and exit
--dry-run     create VM and load main class but do not execute main method.
              The --dry-run option may be useful for validating the
              command-line options such as the module system configuration.
--validate-modules  validate all modules and exit
              The --validate-modules option may be useful for finding
              conflicts and other errors with modules on the module path.
-D<name>=<value>
              set a system property
-verbose:[class|module|gc|jni]
              enable verbose output
-version      print product version to the error stream and exit
--version     print product version to the output stream and exit
-showversion  print product version to the error stream and continue
--show-version
              print product version to the output stream and continue
--show-module-resolution
              show module resolution output during startup
-? -h -help
              print this help message to the error stream
--help        print this help message to the output stream
-X            print help on extra options to the error stream
grizzthedj
  • 7,131
  • 16
  • 42
  • 62
Karolina
  • 1
  • 2
  • First of fall you add the java environment path. @karolina – Ng Sharma Mar 12 '18 at 17:38
  • Follow this link – Ng Sharma Mar 12 '18 at 17:40
  • https://www.java.com/en/download/help/path.xml @karolina – Ng Sharma Mar 12 '18 at 17:41
  • If you don't understand then follow this link – Ng Sharma Mar 12 '18 at 17:43
  • https://stackoverflow.com/questions/1672281/environment-variables-for-java-installation – Ng Sharma Mar 12 '18 at 17:43
  • it just means that zou have to provide which (main) class should be executed, that is, the class which contains the main method to be executed (or, with `-jar`, the JAR file to execute). Better help: [java](https://docs.oracle.com/javase/9/tools/java.htm#GUID-3B1CE181-CD30-4178-9602-230B800D4FAE) – user85421 Mar 12 '18 at 19:30
  • 2
    Well, what you're doing is just telling your command prompt to execute `java` tool. But not using what parameters, so in short you are saying lets dance but without the music. Read the synopsis [at the documentation](https://docs.oracle.com/javase/9/tools/java.htm#JSWOR624)(since you tagged this with Java-9) for a better understanding of how the tool works. *There is a defined syntax to be understood there.* Voting to close this currently as off-topic. By the way, Java is installed on your machine and the path is set right as well if you see that usage/help prompt as shared in the question. – Naman Mar 13 '18 at 02:59

0 Answers0