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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:10:05+00:00 2026-06-13T01:10:05+00:00

I am learning java with BlueJ, and recently I was given a .jar file

  • 0

I am learning java with BlueJ, and recently I was given a .jar file called Imagen.jar. Apparently, what it does is return some pixel vectors depending on image file names given as parameters to it.

Anyway, I am supposed to make a program that will use a class called Imagen. Apparently, such class is within the mentioned .jar file.

Clearly, BlueJ won’t compile if I’m using such class since I have not imported it or anything. But, I don’t really know how to import such class in the first place.

I was given the following example code:

import java.io.PrintWriter;

public class Main {
   public static void main(String arg[ ]){
      if(arg.length > 1){
         Imagen imagen = new Imagen(arg[0]);
         int [][] m = imagen.getMatriz();
         PrintWriter salida = null;
         try {
             salida = new PrintWriter(arg[1]);  
         }
         catch(Exception e){
            System.err.println(e);   
         }
         for(int [] fila : m ){
            for(int valor : fila){
               System.out.print("\t"+valor);
               salida.print("\t"+valor);
            }   
            salida.println("");
            System.out.println("");
         }
         if(salida!=null){
            salida.close();
         }
      }
      else {
         System.out.println("Uso: java -classpath .;Imagen.jar Main nombreArchivo.gif");  
      }
   }
}

Which does not compile using BlueJ. However, as you can see, at the end it says that to use it, you have to type in the terminal:

java -classpath .;Imagen.jar Main myImageFile.gif

And I do it. But it keeps throwing me the same message.

So I am stuck right now:

  • Why is the terminal line I was told to use not working?
  • How can I import the class that is contained within a .jar file?
  • 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-13T01:10:07+00:00Added an answer on June 13, 2026 at 1:10 am

    You need to do the following once.

    Select the menu option Tools -> Preferences.
    In the resulting dialog, click on the Libraries tab.

    enter image description here

    Click the Add button.
    Navigate to the folder containing jar file. Select jar file.
    Restart BlueJ.

    Answer extracted from this place

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

Sidebar

Related Questions

i recently started learning Java. I was studying Vectors and I came across various
I am learning Java with Swing and I have some problems with using JTextField
I am learning Java and have been given these options: How can you implement
Learning java server technologies, trying to clarify some things. There are few technologies that
I am learning Java OOP. My program downloads file via FTP. I want to
I've recently starting learning java web development and I want to learn/understand: What constitutes
I am learning Java and have a pretty basic problem. I am indexing some
I'm learning Java's generic, I snag into some problem instantiating the type received from
I recently started learning Java and found it very strange that every Java public
I have recently started having a need to start learning Java Script. My application

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.