Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 392789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:11:37+00:00 2026-05-12T16:11:37+00:00

So I finally took the dive and installed maven2 but I’ve got some problems.

  • 0

So I finally took the dive and installed maven2 but I’ve got some problems.

My code relies on some third party jars which I installed using install:install-file. I then listed those jars as dependencies in my pom. Maven can compile and package it all fine and dandy. But when I run my jar like so:

java -cp “target/*” com.blah.App

It doesn’t work because it cannot find some classes which are needed at runtime.
Those classes are in a jar which has been installed and is used for compilation.

I have listed the scope of the dependency as for that jar as “provided”. I tried using “system” as well, but that doesn’t work either. What am I doing wrong?

I can get it to run if I do this though:

java -cp “target/*:path/to/jar1:path/to/jar2” com.blah.App

But there must be some way to get maven to put the required jars in the target directory.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T16:11:38+00:00Added an answer on May 12, 2026 at 4:11 pm

    You should not be using “provided” for normal dependencies. “Provided” is used for dependencies that are assumed to be available at runtime, such as J2EE APIs for a J2EE app.

    The reason your application doesn’t work is that now your dependencies are located in the maven repo, and they need to be added to the classpath.

    For a normal java application such as yours, you can use the maven-dependency-plugin to copy your dependencies to a directory (from the maven repository) and configure the maven-jar-plugin to add the jar files to your manifest classpath (by creating an executable jar).

    Update:
    You might also want to search the maven central repository to see if your dependencies are already there, so you don’t have to mess around with manually installing them into your local repo. There’s a good chance they’re already there (if they’re open source).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It took me a long time but I finally got nHibernate's Hello World to
Well, now that I've finally got my stupid ODBC stuff configured, I took a
I finally got my group to switch from SourceSafe to Subversion. Unfortunately, my manager
I'm finally getting my team to embrace source code management now that we're working
I have finally got the green light to use Memcached in our project (after
I've finally got the datepicker to work on my MVC demo site and also
I took this sample code here : Django ORM: Selecting related set polls =
I took Computer Networking last semester and did some C programming in linux (using
I finally have a hardware guy that is insterested in controlling the firmware. This
I finally found out the difference between UTC and GMT by making the effort

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.