Solved

Netbeans 3.5.1: Can not import a jar file

Posted on 2003-10-29
7
1,008 Views
Last Modified: 2013-11-23
I am a newcomer, using Netbeans 3.5.1 for research purpose. I am supposed to compile two packages which can be found at

1) http://people.cs.uct.ac.za/~evoges/web/GiST.zip
2) http://people.cs.uct.ac.za/~evoges/web/BT.zip

I can successfully compile the first one, but failed to compile the later.

Netbeans reports an error message: BTroutines.java [6:1] package GiST does not exist

I have tried all my best to mount/install the specific GiST jar which is from 1). However, it still does not compile. Interestingly, I can compile 2) by using command line.

Solutions are in highly appreciation.
0
Comment
Question by:verveshen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
7 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 9643186
Don't know NetBeans, but you could

1. Do the first one
2. Import the package created by the first
3. Do the second
0
 

Author Comment

by:verveshen
ID: 9643878
Yes, I did. However, it does NOT work in netbeans while runs smoothly in dos console.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9644531
Well you'll have to read the manual then ;-)
0
 
LVL 3

Accepted Solution

by:
savalou earned 125 total points
ID: 9647574
Since you've given very little information on what exact steps you took, I'm going to spell it all out.  

You need to look in the Java files for the package directive.  If it says
package x.y.z;

then the java file should be in directory WORKDIR/x/y/z.  In Netbeans, mount the directory WORKDIR and then right-click on it and choose "Add to project."  Then you can go to the project view and build/compile your files.  If you make a jar of the class files, it is important to keep the directory structure.  You can then mount the JAR as an archive in Netbeans and it's added to your development classpath.  
0
 
LVL 3

Expert Comment

by:savalou
ID: 9647585
NetBeans asks that you respect the packaging rules of Java.  You could have all your java files in a single directory irrespective of their packaging and do a javac at the command line on them and it will compile.  But  you can't use the classes like that, the classloader will want them to be in directories.  
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This video teaches viewers about errors in exception handling.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question