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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:42:42+00:00 2026-06-17T20:42:42+00:00

So I have packed my classes and their dependancies (apache commons cli) inside a

  • 0

So I have packed my classes and their dependancies (apache commons cli) inside a jar file using one-jar (which was easy enough to do, see section Command-Line Approach). Now I am curious if I can run the java test class inside the jar using a Junit jar outside the class. So the path to the test class inside sw.jar is :

sw.jar\main\sw.jar\uoa\di\ys11\hw2\TestSmithWaterman.class

(the main\ is a one-jar thing). I have tried variations of :

java -jar -cp lib/junit.jar org.junit.runner.JUnitCore  uoa.di.ys11.hw2.TestSmithWaterman

with no luck – so what would the command line be ? Or do I need to modify the one-jar manifest somehow ?

EDIT : the /boot-manifest.mf:

Manifest-Version: 1.0
Main-Class: com.simontuffs.onejar.Boot
One-Jar-Main-Class: uoa.di.ys11.hw2.Hw2

while the /META-INF/MANIFEST.MF:

Manifest-Version: 1.0
Created-By: 1.7.0_09 (Oracle Corporation)
Main-Class: com.simontuffs.onejar.Boot
One-Jar-Main-Class: uoa.di.ys11.hw2.Hw2
  • 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-17T20:42:43+00:00Added an answer on June 17, 2026 at 8:42 pm

    Use the following command line to test

    java -cp lib/junit.jar;sw.jar org.junit.runner.JUnitCore  uoa.di.ys11.hw2.TestSmithWaterman
    

    EDIT:

    this should be work with normal jars, but the jar is created by the one-jar

    One-JAR lets you package a Java application together with its
    dependency Jars into a single executable Jar file.

    After that it’s not possible for junit, as I mention junit-4.4 in my case to load such classes for test.

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

Sidebar

Related Questions

I have got a JAR file which contains Utility classes, that are used in
I have same class file under classes folder and also in jar file inside
I have created a java application and packed it into a jar file on
I have made a java application and have packed it into an executable jar
HI I have created a ActiveX componed and packed into a cab file 1)
I have classes which are inherited from abstract Packet( this class has abstract method
I have my project classes organized in multiple src folders, which have been working
I have a bunch of different Feature classes which calculate image features. I have
I have a class, GamePacket , from which all packet classes extend from. I
I have a properties file that I currently have in this folder: /src/webapp/WEB-INF/classes/my.properties I

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.