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
It took me FOREVER to finally find code that can download a doc file
It took a good bit of trial and error, but I was finally able
It took me hours to finally get the format right on all browsers but
So I took some time this afternoon to finally sit down and begin reading
Finally deployed my ruby on rails 3.2 app but when trying to open it
Finally figured it out thanks to One Mad Monkey, but forgot quotes on my
I finally figured out how to implement pg_search's multisearch feature. But I'm having trouble
I finally got apache2 with mod_wsgi working on Linux (havent much luck with windows

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.