• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

How to add a jar file in classpath?

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This might seem like a silly question, but I've been feeling annoyed at not knowing what to do. I have imported a Maven project into Netbeans, and just purchased a commercial library for use (Incors' Alloy). I need to import the alloy.jar into my classpath. I installed it using the mvn install, but in Netbeans, a few java files that import the Alloy class give me a compilation error. I used to import jars into the Netbeans environment by just right clicking on project properties - Library -> and so on. But in this Maven project, no such option seems available! ANy ideas?
Much appreciated, thank you very much.

Harish.
 
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually it's quite easy to do it in NetBeans. I'm assuming that you use NetBeans 6.7.x that has good Maven support.

I hope you've already included the Incors' Alloy dependency in the pom.xml.

To install the JAR:
1. Right click on that Incors' Alloy JAR icon (the icon will look blurry, which means you don't have the JAR in your local repo) on the library section of your project. 2. Click Manually Install Artificat.
3. Select your JAR and provide all the information required.

Alternatively, you can do it from command line to install the JAR, e.g.


Hope it helps.
 
harish kshatrea
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just did that, and it works!
I guess I got to start paying more attention.
Thank you so much, Freddy!

Cheers,
Harish.
 
When people don’t understand what you are doing they call you crazy. But this tiny ad just doesn't care:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic