package javax.el does not exist
Asked Answered
B

5

9

i'm using jre6/eclipse and importing javax.el.* the error

package javax.el does not exist [javac] import javax.el.*;

comes up. isn't this supposed to be part of java? can anyone tell me why this might be. thanks m

Bluenose answered 28/1, 2010 at 22:25 Comment(0)
B
2

I am developing through eclipse. I am not currently using a Dynamic Web Project but I am using ant to build the app.

Having already included this (ages ago and then forgetting):

I then add el-api.jar to my servlet container setup:

<path id="compile.cliClasspath">
    <fileset dir="${cliLibDir}">
        <include name="*.jar" />
    </fileset>
    <fileset dir="${cliTomcatlib}">
        <include name="servlet-api.jar" />
        <include name="jsp-api.jar" />
        <include name="el-api.jar" />
    </fileset>
</path>
Bluenose answered 28/1, 2010 at 22:42 Comment(0)
G
7

EL (the Unified Expression Language) is part of the Java EE spec. You can find this library as part of any Java EE server or JSP container. Implementations are also available separately from Glassfish, Apache or JUEL.

Gonad answered 28/1, 2010 at 22:33 Comment(1)
Apache no longer maintains EL. Glassfish's EL is located at repo1.maven.org/maven2/org/glassfish/javax.elIntermix
D
3

This is usually part of the servlet container in question (a servlet container is basically a concrete implementation of the Servlet/JSP/EL parts of the abstract Java EE API). The needed libraries are usually available in ServerInstallFolder/lib. You basically need to just include it in the compiletime classpath.

However, when developing in Eclipse, it's normal practice that you integrate the server in question in the Servers view and associate the Dynamic Web Project with it. In the servers view, just add a new server and locate the existing server installation. Then you should see this listed during Dynamic Web Project creation wizard. You can also add/change it afterwards in Servers section of the project properties.

Once done that, Eclipse will just automagically include the server's libraries in the Build Path of the project (read: the IDE-managed classpath which is used in both compile- and runtime), including the javax.el ones.

Drawshave answered 28/1, 2010 at 22:31 Comment(2)
@Mark Lewis: downvoting because your question didn't cover that you were using ant to build the project is pretty lame, isn't it? :/Drawshave
I've just seen this. Sorry, I only started developing in January - Ant, java, JSF, el etc. are all new to me. Given that, I'm naturally going to miss items now and again.Bluenose
B
2

I am developing through eclipse. I am not currently using a Dynamic Web Project but I am using ant to build the app.

Having already included this (ages ago and then forgetting):

I then add el-api.jar to my servlet container setup:

<path id="compile.cliClasspath">
    <fileset dir="${cliLibDir}">
        <include name="*.jar" />
    </fileset>
    <fileset dir="${cliTomcatlib}">
        <include name="servlet-api.jar" />
        <include name="jsp-api.jar" />
        <include name="el-api.jar" />
    </fileset>
</path>
Bluenose answered 28/1, 2010 at 22:42 Comment(0)
W
1

The servlet API is not "part of Java"; it's defined by the Java EE ("enterprise edition"), and can be found in the libraries provided by your servlet container.

Worsley answered 28/1, 2010 at 22:28 Comment(0)
T
0

I had the same issue. I had to include the jar tomcat/lib/el-api.jar to my web-inf/lib folder and ant build worked fine :)

Tramp answered 21/2, 2013 at 17:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.