problem importing jexcel in netbeans
I am a new member, and this is my first post so please bear with me. I am trying to import the jxl package into Netbeans so that I can read excel files in java, but I am getting an error.
Things I have done:
I have downloaded the jexcel files, which consist of a jxl-core.jar file and a jxl-reader.jar file.
I have saved these files into the same folder as the package I am trying to use.
In NetBeans, I went to package>properties>library and added the two jar files to the classpath.
Finally, I tried to import the package by using "import jxl-reader.*;" and "import jxl-core.*;"
but I am getting an error that sometimes says "missing '.'" I am assuming this has to do with the file not existing, because a minute ago it was giving me a "package jxl-core does not exist" error.
I do not know how to use command line, and I also do not know how to use apache or deal with the .xml file.
Can someone please help? I would really appreciate it, and am willing to learn how to use apache or the command line if necessary.
thanks in advance,
Re: problem importing jexcel in netbeans
The exact procedure will depend on the version of Netbeans you are using; currently I have both 7.2 and 7.3 beta 2 installed and the procedue for these is generally the same.
First, I advise against copying the .jar files into any of your project folders - netbeans will handle that for you.
I keep all of my third party library files in a separate directory c:\javalibs with appropriate subdirectories for all the .jar files.
Once you have decided where to keep the original .jar you need to use the NB menu Tools | Ant Libraries and click on the button New Library. Give the library a meaningful name such as 'jexcel' and library type is 'class libraries'. Once you have done this, use the Add Jar/Folder button and add the all the relevant .jar files to the classpath tab. Take the time to fill in references to the sources and javadoc while you have the Ant Library Manager window open.
Once you have completed the library definition, open up the Project Properties dialog and add the library you just created. If when you created the project initially, you elected to store all libraries in a project folder, the procedure is slightly different - you first need to import the library into those available to the project - and then add the library. The first crucial step is to create the library in the first place!!
Once you have the library referenced in the Project Properties compile-time tab you will be able to import the packages you need.