1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/java.md

20 lines
547 B
Markdown
Raw Normal View History

2015-12-16 03:51:52 -05:00
# java
> Java Application Launcher.
- Execute a java .class file that contains a main method by using just the class name:
2015-12-16 03:51:52 -05:00
2017-12-30 21:37:37 -07:00
`java {{classname}}`
- Custom input and output files. Preferably .txt files. This is useful when you don’t want to input from keyboard every time you run your class. Outputs from `System.out.println();` are saved in the output file:
`java {{classname}} <{{path/to/inputfile}}> {{path/to/outputfile}}`
2015-12-16 03:51:52 -05:00
- Execute a .jar program:
2015-12-16 03:51:52 -05:00
`java -jar {{filename.jar}}`
- Display JDK, JRE and HotSpot versions:
2015-12-16 03:51:52 -05:00
`java -version`