Solved

Netbeans 3.5.1: Can not import a jar file

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
allswap challenge 6 80
maven example error 3 54
AWS and Java and Rest - newbie question (Is this an authentication issue) 4 68
Spring Framework HTTPSession management 1 24
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
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:

863 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

27 Experts available now in Live!

Get 1:1 Help Now