14

I've created a Maven project and added the dependencies (jar files) that I need; however, netbeans says that it still cannot find it.

Specifically in my case, I added the jmf-2.1.1e.jar file into my dependencies folder. When I go back to my program it still gives me the compile error that it cannot find the javax.media package.

Allen
  • 141
  • 1
  • 1
  • 3

4 Answers4

17

Did you let Netbeans manage the dependency?

In your "Projects" listing, find and context+click on the "Dependencies" folder in the list. From the context menu, choose "Add Dependency".

screen shot of Projects listing with context menu of Dependencies folder

This approach works at least in NetBeans 7.4 and 8.0 beta.

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
  • 1
    Does this menu allow to add dependency from file? – zygimantus Jan 18 '17 at 11:12
  • 1
    @zygimantus If you mean adding a local copy of a library to your project, No. That is not a “dependency” which means letting a software tool like Maven do the work on your behalf to locate on the Internet a source for the desired library, download, and install it within your project. You can manually add a library yourself, but doing so does not involve a “dependency manager” such as Maven. See [introduction](https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html) on Maven site. – Basil Bourque Jan 18 '17 at 13:32
  • 1
    In Maven fantasy world it's "not a dependency", but in real life it's a project dependency. Maven is stupid. – User Jan 31 '17 at 22:58
  • How do you make the **Dependencies** node appear; so i may right-click it to add a dependancy? – Ian Boyd Jul 20 '22 at 02:47
6

Make sure that your pom.xml has the following snippet that defines the dependency

  <dependencies>
    <dependency>
        <groupId>javax.media</groupId>
        <artifactId>jmf</artifactId>
        <version>2.1.1e</version>
    </dependency>
   </dependencies>
Arsh Coder
  • 688
  • 9
  • 33
Tim Sparg
  • 3,294
  • 2
  • 27
  • 40
2

The dependency is available in Maven Central. Add the pom snippet manually to the pom.xml and run Maven in the shell and let it download the dependency. This should resolve your issue.

Michael-O
  • 18,123
  • 6
  • 55
  • 121
1

Maven automatically downloads the dependency once specified in the pom.xml. For this you would have to build your project with the dependency as specified by Tim Sparg.

Bala
  • 1,193
  • 2
  • 12
  • 34