开发者

Eclipse Indigo (EE) + Java EE 6. Where are the classes in "javax.*"?

开发者 https://www.devze.com 2023-03-23 17:16 出处:网络
I\'ve just installed Eclipse Indigo for EE an开发者_JS百科d Java EE 6 SDK/JRE from Sun. I need all those to compile a 3rd party Java project using the \"javax.*\" classes. What I cannot understand how

I've just installed Eclipse Indigo for EE an开发者_JS百科d Java EE 6 SDK/JRE from Sun. I need all those to compile a 3rd party Java project using the "javax.*" classes. What I cannot understand how to reach those classes?

How can I import or otherwise connect to "javax.*" classes inside Eclipse?


They're in the Java EE implementation. In other words, they're in the application server. For example, Glassfish, JBoss AS, Tomcat, etc.

In Eclipse, just integrate the target server in Servers view and associate the dynamic web project with it. You can select it during dynamic web project creation wizard:

Eclipse Indigo (EE) + Java EE 6. Where are the classes in "javax.*"?

or afterwards via Targeted Runtimes in project's properties:

Eclipse Indigo (EE) + Java EE 6. Where are the classes in "javax.*"?

Once associated the project with the application server, Eclipse will do all the necessary magic to make those classes available during compiletime. To verify it, the associated server should be listed as Library in project's Build Path property:

Eclipse Indigo (EE) + Java EE 6. Where are the classes in "javax.*"?

Note once again, you don't need to change/fiddle anything in there! If you did some attempts beforehand while shooting in the dark in order to "fix" this problem, then you should make sure that you've undone it all, or things may still go wrong.

See also:

  • How do I import the javax.servlet API in my Eclipse project?


Make sure you have all the settings in preferences set. Go to 'Window' -> 'Preferences' and then check the 'Installed JREs', point it to your newest and greatest jre within downloaded jdk. If that doesn't work, download jdk and eclipse Java EE again and start from scratch. Also make sure you have a java and javac added to your PATH (either on Linux or Windows)

0

精彩评论

暂无评论...
验证码 换一张
取 消