Skip to main content
GameDev.net gamedev.net
🔒 Locked

Netbeans - Using a Library

Started by matthughson Apr 9, 2006 at 6:13 PM 2 replies 4.7k views
Original Post
matthughson
matthughson
Hey Guys, I'm really new to this stuff, and I need to use an external library, but I have no idea how to get it into my project. I'm using NetBeans, and I'm totally new to the IDE and Java in general. The library include the follow files: GoFP.prc MathFP.class MathFP.pub What am I supposed to do with this so that I can use the library in my project? Thanks, Matt [Edited by - matthughson on April 11, 2006 9:50:36 PM]
__________________________________[ Website ] [ Résumé ] [ [email=contact[at]matthughson[dot]com]Contact[/email] ][ Have I been Helpful? Hook me up! ]
shmoove
shmoove
Right click on the project in the project explorer window, choose "Properties". In the treeview go to "Libraries & Resources". There you can choose to add other projects, folders, jar/zip files or installed libraries.

shmoove
matthughson
matthughson
Ok,

So I added a new folder called libs, and extract the 3 files to that folder. Then I added the folder to the project properties as an additional library (as you described).

However, now when I compile I get this error:

Error preverifying class MathFP    Class loading error: Wrong name...\nbproject\build-impl.xml:269: Preverification failed with error code 1.BUILD FAILED (total time: 0 seconds)

I've noticed, in my little experience with Java over the last week, that it seems like the file needs to have the same name as the class it contains, and not doing so gives an error like this. As far as I can tell from the documentation for this library, the class name is MathFP and the file is MathFP.class.

I'll keep trying some different stuff, but any help would be fantastic!
Matt

[Edited by - matthughson on April 10, 2006 9:38:19 PM]
__________________________________[ Website ] [ Résumé ] [ [email=contact[at]matthughson[dot]com]Contact[/email] ][ Have I been Helpful? Hook me up! ]
matthughson
matthughson
Ok found my answer on another forum. For any who runs into the same problem here is the answer:
Quote:

extract the MathFP.class from the file downloaded. Then create a dir

net/jscience/util then paste the extracted MathFP.class then zip it as MathFP.zip

then create lib folder on the Project Directory then paste the MathFP.zip in the lib folder.

Open Project Properties, Libraries and Resources then ADD JAR/ZIP.

that's it... import it as "import net.jscience.util.MathFP"...


The entire thread (which deals with a few other IDEs and such, can be found here.

Matt
__________________________________[ Website ] [ Résumé ] [ [email=contact[at]matthughson[dot]com]Contact[/email] ][ Have I been Helpful? Hook me up! ]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.