how to include javax.jms.* in eclipse?

前端 未结 9 1311
太阳男子
太阳男子 2021-02-05 17:10

Iam trying to implement JMS using eclipse.But when I tried to save the code, it showed that javax.jms.* cannot be resolved and there are no suggestions

9条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-05 17:19

    There are actually many ways to fix this. As already stated in the comment you need the Java Enterprise Edition API. Java EE is an abstract specification so what you need is an implementation of the JMS API. Since JMS is part of the Java EE specification the easiest thing is to download a application server such as GlassFish (which is the reference implementation) or JBoss.

    I assume you already got the Java compiler so you only need the SDK, not the JDK.

    Java EE 6 SDK Update 4 A free integrated development kit used to build, test, and deploy Java EE 6 applications.

    http://www.oracle.com/technetwork/java/javaee/downloads/index.html

    Then after you have downloaded GlassFish you will end up with a lot of files that is an implementation of the different Java EE specification API's. You will probably want to download the plugin that I linked to beneath so that you can start, deploy and do many other administration task of your server from Eclipse. I do not use Eclipse so I don't remember if you want this version of Eclipse as well.

    http://marketplace.eclipse.org/node/867

    At last you want to add GlassFish to your buildpath.

    I found this blog post (Scroll to "Create projects in Eclipse") if you are unsure what to add, but there are several blog posts on how to add GlassFish to the build path in Eclipse so I won't list them here.

    http://www.webagesolutions.com/knowledgebase/javakb/jkb005/index.html

提交回复
热议问题