Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Netbeans 3.5.1: Can not import a jar file

Posted on 2003-10-29
7
Medium Priority
?
1,018 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 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
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:
Suggested Courses

609 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