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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:41:31+00:00 2026-06-17T03:41:31+00:00

I’m new enough to the idea of using external class libraries and APIs not

  • 0

I’m new enough to the idea of using external class libraries and APIs not native to Java that I don’t even know if I’m asking the right questions with the right terminology. So let me explain what I’m doing.

I need to read and write to an Excel file. I found this page that has a Java-Excel API. I want to get that API installed and available for my local instance of Java (C:\java\) so I can just import these classes when i create a new program (e.g., import jxl.CellView). I have a zip file from sourceforge, but after that, I’m just lost.

The instructions reference setting it up in Eclipse; I’m not a fan of Eclipse as an IDE…so I want to know how to do it “manually”. I think this will help me better understand why it works the way it does for the future.

So, my next instruction is…
“To use this library in your Java program add the lib jxl.jar to your classpath in your project. See Changing classpath in Eclipse.” Do I just unzip the zip file to C:\java? Is that what they mean by my class path? What are the steps I need to follow from here to ensure I can import the appropriate classes as needed?

Further, do these classes get bundled with applets? When I compile a java program, will the recipient of that file be able to run it even if they don’t have this particular package installed on the machine on which they’re running it?

Can someone give me some perspective on this?

  • 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-17T03:41:33+00:00Added an answer on June 17, 2026 at 3:41 am

    I like to put all my third party libraries in c:\java\lib. That way I can keep them separate from the JREs and JDKs I have in c:\java. This is not strictly necessary, but it’s nice to be tidy. Here are some instructions specific to using the library you’re interested in.

    Extract jexcelapi_2_6_12.zip to c:\java\lib\.

    This should mean the following file now exists: C:\java\lib\jexcelapi\jxl.jar.

    Let’s put your code in c:\java\work for now, to keep it separate. Create the file c:\java\work\MyClass.java using a text editor:

    import jxl.CellView;
    public class MyClass {
        public static void main(String[] args) {
            System.out.println("I can access " + CellView.class);
        }
    }
    

    Open a command prompt and change directory to c:\java\work.

    cd /d c:\java\work

    Now compile the class:

    javac -classpath ..\lib\jexcelapi\jxl.jar MyClass.java

    If you get no errors, the directory should now contain a new file MyClass.class, which is your compiled program.

    If you see the error:
    ‘javac’ is not recognized as an internal or external command, operable program or batch file. then you could specify the full path to javac.exe. The following example assumes you have a JDK located in c:\java\jdk1.6.0_37, which may or may not be true on your system:

    c:\java\jdk1.6.0_37\bin\javac -classpath ..\lib\jexcelapi\jxl.jar MyClass.java

    Run your compiled program:

    C:\java\work>java -classpath ..\lib\jexcelapi\jxl.jar;. MyClass

    Output:
    I can access class jxl.CellView

    Notice the semicolon and dot at the end of the java classpath. This adds the current directory to the classpath so that java can find MyClass.class. That was not necessary with javac.

    Unlike PATH, which should contain only directories, java’s CLASSPATH (or -classpath) can contain both files and directories. When a file appears in the classpath it should be a JAR. Since JARs are just zip files, you sometimes also see ZIP files in classpaths. This is non-standard, but it works. Java will treat the .zip file as a .jar. If you needed to add some second library to your program, separate the files with a semicolon (Windows) or colon (*nix).

    javac -classpath ..\lib\jexcelapi\jxl.jar;..\lib\lib-2.0\lib-2.0.jar MyClass.java

    Sometimes libraries consist of more than one jar file. In this case, you will need to add every JAR file that is a part of the library to the classpath. Again, separate them with semicolons. If this seems tedious, you’ll start to see why people like to use IDEs or Ant to work with Java rather than command line commands.

    There are many things still to learn like using packages, using the environment variable CLASSPATH to set the classpath instead of using the -classpath command line argument, adding your JDK bin directory to your PATH, adding more than one entry to the classpath, creating shell scripts to make rebuilding and rerunning your program easier, using IDEs for development, and Maven/Ant for building, making your own JARs, … the list of things to learn goes on and on. This post is not meant to indicate best practices, but rather to get you up and running quickly. Follow the Oracle documentation and other best practices posted on the Internet to keep improving your Java development environment.

    Further, do these classes get bundled with applets?
    If your program is eventually going to be an applet, then yes, you will need to distribute jxl.jar with your program — people are not going to have it on their computer, nor are they going to want to download it on their own. I am not going to describe how to make Applets here. There are lots of resources on the web. Google for it and come back with more specific questions about problems you run into.

    When I compile a java program, will the recipient of that file be able to run it even if they don’t have this particular package installed on the machine on which they’re running it?
    The jxl library does not get compiled into your program. You will need to deliver the jxl library to your users somehow, along with your program. You should probably bundle your program up into a JAR, since most non-trivial programs consist of more than one Java class, and that means your program will consist of multiple .class files. There are a number of ways to approach this problem. Spend some time reading resources on how to create applets and then come back to stackoverflow with more specific questions.

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I have thousands of HTML files to process using Groovy/Java and I need to
I am using JSon response to parse title,date content and thumbnail images and place
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace

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.