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 8290479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:49:38+00:00 2026-06-08T12:49:38+00:00

I have a newbie Java question. I had to make suite of J/DBUnit tests

  • 0

I have a newbie Java question.

I had to make suite of J/DBUnit tests for some stored procedures we use in SQL Server. These tests use some XML files in a couple of sub-directories that I originally had placed in the same directory as my Java project.

Anyway, upon checking these tests in, our SVN manager wanted to keep the .java files in one part of the tree, and resources (like the XML files and required JARs) in another part of the tree.

So, my tests had originally referenced the XML files with a relative path which doesn’t work now.

My question is:

  1. Can I make the directories with my XML files available with the CLASSPATH (I hope so).
  2. Assuming that works, how do I reference a file in my code that was included this way?
  3. If I shouldn’t be using the CLASSPATH for this, I’m open to other solutions.
  • 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-06-08T12:49:41+00:00Added an answer on June 8, 2026 at 12:49 pm

    Using the classpath is no problem, the standard maven project layout looks like the following:

    • src
      • main
        • java
        • resources
      • test
        • java
        • resources
    • target
      • classes
      • test-classes

    The compiler compiles src/main/java to target/classes, the resources of src/main/resources are copied to the target/classes folder, similar for the tests. If the tests have a classpath containing classes and test-classes, all works fine.

    How is your project layout is, how is it build?

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

Sidebar

Related Questions

I'm brand new to SQL Server 2008, and have some newbie questions about the
I am a newbie and have some question on using jdbc with java: What
A newbie question. I have the following piece of Java code: import acm.program.*; import
I am a Java newbie, hence the simple question: I have a class whose
Sorry for the potentially stupid question, I'm newbie in Java. I have a simple
I have a newbie question for writing makefile for java in Linux I have
Newbie question, but I have this code: import java.util.*; import java.io.*; public class Welcome1
I'm a newbie in java and I have a small problem. I want to
I have a newbie question about integrating two iOS apps. I have created an
I have a newbie WPF question. Imagine my user control has a namespace declaration

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.