After many beginners have just touched eclipse, write a code file. For example, after Demo.java is generated by the run as a Java application, a demo.class is generated.
Demo.class Address (D:demo.class)
We opened the DOS command and found Demo.class.
Think that already time bytecode file, so do not need Javac Demo.java
D:
CD Java Demo
The system will error, cannot find the main function main, cannot run this program!
What causes that?
Because a package COM will be generated in Eclipse. Packet name
The DOS command line cannot find the package name from the current path. So I can't run the program.
Solution:
1. Open the demo in Eclipse and delete the package COM. Packet name.
2. Change the path of the input in the DOS command-the path of the package (\.. \.. \>) java com/package name/demo (back slash after Java)
Java Eclipse generated bytecode file, how to open with a DOS command