cmd编译java程序包不存在,“javax.inject包不存在”在命令行中用javac编译时出错

I'm making my first steps toward learning JSF. I found this interesting book called "Core JavaServer Faces Third Edition".

Trying to compile the first example, you can download the source code from: http://horstmann.com/corejsf/. When I type the following on the command-line

javac UserBean.java

I get errors:

package javax.inject does not exist

package javax.enterprise.context doe not exist

I have downloaded Java EE, Ant and GlassFish.

Here is a snap of my command-line:

C:\JSF-Tutorial\corejsf3-examples\javaee\ch01\login\src\java\com\corejsf>javac UserBean.java

UserBean.java:4: error: package javax.inject does not exist

import javax.inject.Named;

^

UserBean.java:6: error: package javax.enterprise.context does not exist

import javax.enterprise.context.SessionScoped;

^</

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
文件夹 PATH 列表 卷序列号为 4E8D-6931 C:. │ .txt │ assess.zip │ └─assess │ assess.sql │ pom.xml │ ├─.idea │ │ assess.eml │ │ assess.iml │ │ compiler.xml │ │ encodings.xml │ │ misc.xml │ │ modules.xml │ │ uiDesigner.xml │ │ webContexts.xml │ │ workspace.xml │ │ │ ├─artifacts │ │ assess_war.xml │ │ assess_war_exploded.xml │ │ │ └─libraries │ Maven__javax_servlet_javax_servlet_api_4_0_1.xml │ Maven__javax_servlet_jstl_1_2.xml │ Maven__mysql_mysql_connector_java_5_1_38.xml │ ├─src │ └─main │ ├─java │ │ └─com │ │ └─demo │ │ ├─bean │ │ │ UserBean.java │ │ │ │ │ ├─dao │ │ │ JdbcUtils.java │ │ │ │ │ ├─service │ │ │ UserService.java │ │ │ │ │ └─web │ │ └─controller │ │ LoginController.java │ │ UserController.java │ │ │ ├─resources │ └─webapp │ │ add.jsp │ │ index.jsp │ │ login.jsp │ │ modify.jsp │ │ │ ├─assets │ │ └─bootstrap-3.3.7 │ │ ├─css │ │ │ bootstrap-theme.css │ │ │ bootstrap-theme.css.map │ │ │ bootstrap-theme.min.css │ │ │ bootstrap-theme.min.css.map │ │ │ bootstrap.css │ │ │ bootstrap.css.map │ │ │ bootstrap.min.css │ │ │ bootstrap.min.css.map │ │ │ │ │ ├─fonts │ │ │ glyphicons-halflings-regular.eot │ │ │ glyphicons-halflings-regular.svg │ │ │ glyphicons-halflings-regular.ttf │ │ │ glyphicons-halflings-regular.woff │ │ │ glyphicons-halflings-regular.woff2 │ │ │ │ │ └─js │ │ bootstrap.js │ │ bootstrap.min.js │ │ npm.js │ │ │ ├─images │ │ background.png │ │ │ └─WEB-INF │ web.xml │ └─target ├─assess-1.0.0-SNAPSHOT │ │ add.jsp │ │ index.jsp │ │ login.jsp │ │ modify.jsp │ │ │ ├─assets │ │ └─bootstrap-3.3.7 │ │ ├─css │ │ │ bootstrap-theme.css │ │ │ bootstrap-theme.css.map │ │ │ bootstrap-theme.min.css │ │ │ bootstrap-theme.min.css.map │ │ │ bootstrap.css │ │ │ bootstrap.css.map │ │ │ bootstrap.min.css │ │ │ bootstrap.min.css.map │ │ │ │ │ ├─fonts │ │ │ glyphicons-halflings-regular.eot │ │ │ glyphicons-halflings-regular.svg │ │ │ glyphicons-halflings-regular.ttf │ │ │ glyphicons-halflings-regular.woff │ │ │ glyphicons-halflings-regular.woff2 │ │ │ │ │ └─js │ │ bootstrap.js │ │ bootstrap.min.js │ │ npm.js │ │ │ ├─images │ │ background.png │ │ │ ├─META-INF │ │ MANIFEST.MF │ │ │ └─WEB-INF │ │ web.xml │ │ │ ├─classes │ │ └─com │ │ └─demo │ │ ├─bean │ │ │ UserBean.class │ │ │ │ │ ├─dao │ │ │ JdbcUtils.class │ │ │ │ │ ├─service │ │ │ UserService.class │ │ │ │ │ └─web │ │ └─controller │ │ LoginController.class │ │ UserController.class │ │ │ └─lib │ jstl-1.2.jar │ mysql-connector-java-5.1.38.jar │ ├─classes │ └─com │ └─demo │ ├─bean │ │ UserBean.class │ │ │ ├─dao │ │ JdbcUtils.class │ │ │ ├─service │ │ UserService.class │ │ │ └─web │ └─controller │ LoginController.class │ UserController.class │ └─generated-sources └─annotations

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值