Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8525921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:07:14+00:00 2026-06-11T08:07:14+00:00

I’m making my first steps toward learning JSF. I found this interesting book called

  • 0

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;
                               ^
UserBean.java:9: error: cannot find symbol
@Named("user") // or @ManagedBean(name="user")
 ^
  symbol: class Named
UserBean.java:10: error: cannot find symbol
@SessionScoped
 ^
  symbol: class SessionScoped
4 errors

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

Been googling how to compile a Java EE application for the last week but without anything useful.

Would someone help me with this please, I need to solve this so I can move forward in my task to learn JSF.

S.P:
I want to learn to compile Java EE applications bare hands before moving to compiling my Java EE projects with NetBeans.
I prefer to learn to work with GlassFish first then maybe latter I’ll consider Tomcat.

One more question; what’s the difference between using Java EE and the GlassFish server to deploy my applications?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T08:07:16+00:00Added an answer on June 11, 2026 at 8:07 am

    You need to include the JAR file containing those classes in the compile time classpath.

    In your particular case with the GlassFish server, that’s the /glassfish/lib/javaee.jar. You can specify the classpath as -cp (or -classpath) argument of javac command. It is a semicolonseparated string of disk file system paths pointing to JAR files and/or class folders which should be included in the compile time classpath.

    javac -cp /path/to/glassfish/lib/javaee.jar UserBean.java
    

    javac will then look in there once it encounters an unknown class which is referenced by import, so that it can among others verify if you used it the right way.

    This has technically nothing to do with Java EE. This is just basic Java. I’d suggest to learn that first before diving into Java EE.

    In case you’re using an IDE, then it’s just a matter of attaching the target server as “Targeted Runtime” to the project. The IDE will then automatically do all magic as to the build path (the compile time classpath).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.