Shane C. Mason
Shane C. Mason

Reputation: 7615

How do I make Netbeans believe I have JMS?

I inherited a project that makes extensive use of JMS. It compiles, runs and passes all of its unit tests using Java 6 SE. I created a netbeans (v 6.5) free form project to go along with it. I added all the libraries and everything correctly (checked this several times). Now, here is the problem: it produces tons of Netbeans error messages saying things like "package javax.jms does not exist" and so forth.

Since the project compiles under JDK 1.6 SE, I assume that javax.jms and friends exists in the JDK. However, Netbeans is obviously not finding it. My only clue as to what might be going wrong here is that under 'Project Properties' I can only select 1.3,1.4 and 1.5 - 1.6 source level is not an option. How can I make Netbeans see javax.jms?

Upvotes: 0

Views: 5440

Answers (3)

SSB
SSB

Reputation: 144

Open Project Properties -> Libraries -> Add Library -> Add Java EE 7 API Library enter image description here

Upvotes: 0

Robin
Robin

Reputation: 24272

JMS is not part of Java SE, it is part of Java EE. You will have to find a javaee.jar or some JMS specific jar that is provided with your JMS implementation.

Upvotes: 2

Michael Myers
Michael Myers

Reputation: 192015

javax.jms is not a standard part of the JDK. When you were compiling at the command line, you probably had some extra JARs on your classpath which NetBeans doesn't know about; jms-1.1.jar was apparently one of these.

So all you need to do is add it as a library in NetBeans. I believe that since this is a free-form project, you'll have to modify your Ant script to do this. Off to try it myself now...

Edit: Here's a reference for setting up the code-completion classpath. I don't have any free-form projects lying around to test with.

Upvotes: 3

Related Questions