1.第一种方法
javac -classpath d:/helloapp/WEB-INF/lib/jsp-api.jar HelloWorld.java
第二种方法
set classpath=d:/helloapp/WEB-INF/lib/jsp-api.jar
javac HelloWorld.java
即先设置classpath然后再编译
2.将java文件编译成jar包,方便以后直接使用。
1)新建一个需要生成jar的java文件
hello.java文件内容
2).使用jar命令编译
d盘生成jar文件
3).编写测试类
使用上面第一种方式运行