JAVA要求你的文件和你的类名严格对应的。
比如 public class HelloWorld{ .....
那么文件名一定只能是HelloWorld.java!
2、你的程序中有main方法吗?参数对吗?
main方法的声明应该是这样子的:
public static void main(String[] args)
3、javac后面跟的参数是文件名,但java 后面跟的是类名!比如:
javac HelloWorld.java
java HelloWorld
4、设置classpath了吗?
不仅是在安装JDK时要设置的内容,一般来说最好还要自己设置一个目录来存放自己的类文件的。比如d:\class目录。设置classpath=%classpath%;d:\class
那么,现在将HelloWorld.class文件拷贝到d:\class目录下,再java HelloWorld应该就行了。
5、结合第3点和第4点
如果你的类是属于某一个包的,比如这样一个类sony.test.HelloWorld,那么按照第4点中的目录来说,就应该将HelloWorld.class文件存放到d:\class\sony\test\目录下。
执行的时候应该参考第3点中说的,按类名执行:java sony.test.HelloWorld。
As Glenn Reynolds writes in his new PM column, traditional knowledge of how to build and fix ordinary things—around the house and in a jam—might be on the decline. With our lives becoming more driven by technology, blue-collar labor has been replaced with more white-collar employment, and teenagers are becoming better at programming Web sites than swinging hammers.
Here at PM, where we at least try to do everything, we spent weeks fine-tuning our list of "25 Skills Every Man Should Know," debating over whether certain items were too basic, too challenging or just too obscure. You can find a full how-to rundown of each one in the October issue of Popular Mechanics, which just hit newsstands. But for now, check out our carefully selected list below, then offer your own arguments and suggestions in the comments section below, or tell us how to perform your must-know skill by writing to us here...
The List: How to...
1. Patch a radiator hose
2. Protect your computer
3. Rescue a boater who has capsized
4. Frame a wall
5. Retouch digital photos
6. Back up a trailer
7. Build a campfire
8. Fix a dead outlet
9. Navigate with a map and compass
10. Use a torque wrench
11. Sharpen a knife
12. Perform CPR
13. Fillet a fish
14. Maneuver a car out of a skid
15. Get a car unstuck
16. Back up data
17. Paint a room
18. Mix concrete
19. Clean a bolt-action rifle
20. Change oil and filter
21. Hook up an HDTV
22. Bleed brakes
23. Paddle a canoe
24. Fix a bike flat
25. Extend your wireless network




