How do i access a third party .class file
Hi,
I am new to both java and enterprise 8, and would greatly appreciate some help.
I have a third party .class file and want to include it in a project so i can call it's methods etc. I can access it by creating an object as follows
thirdPartyClass tpc=new thirdPartyClass();
and then create a .class file of my own using javac at the command line without any probles, but if I use the same code in enterprise 8 it reports an error stating "cannot access MyProjectName.thirdPartyClass" could someone please tell me how to reference this file as so far I have not been able to find anything.
Thanks for any help.
# 1
Has the thirdparty library been added to the project (either directly or via a library)?
The following URL provides a flash demo of library manager in netbeans:
http://www.netbeans.org/files/documents/4/484/LibraryManager.swf
The following tutorial shows you how to use NetBeans IDE 5.0 and Java Excel library together:
http://www.netbeans.org/kb/articles/excel-tutorial.html
# 2
Expand your project's node, right-click on the Libraries subnode, select Add JAR/Folder... and point to the directory with your .class files. Please be sure to handle packages directory tree properly - i.e. if your .class file is in foo.bar package and the file resides in src/foo/bar directory tree, add the "src" directory.
# 4
Thanks for the suggestions it appears I was doing more or less the right things but miss reading the error message:
Cannot access keyword.classes.thirdPartyClass
bad class file C:\java\keyword\classes\thirdPartyClass
class file contains wrong class: thirdPartyClass
please remove or make sure it appears in the correct subdirectroy of the classpath.
While looking I have found that the classes do not contian src folders of Javadoc so I will go see if the third party can supply a Jar file or similar.
Thanks