Solved

Netbeans 3.5.1: Can not import a jar file

Posted on 2003-10-29
7
993 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
  • 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

762 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now