tags:

views:

917

answers:

2

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?

+3  A: 

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.

Michael Myers
Thanks, I verified that the needed jars were included in the source path, but Netbeans still did not see them. I think that it has something to do with the funky build scenario. Eclipse worked out of the box, so I will just soldier forward with that.
Shane C. Mason
+2  A: 

JMS is not part of JSE, it is part of JEE. You will have to find a jee.jar (j2ee.jar) or some jms specific jar that is provided with your jms implementation.

Robin
So, there was a java ee jar in one of the source path folders (verified that javax.jms was in there using jar browser. However, netbeans still failed to see it.
Shane C. Mason