Quantcast

Using .so and .dll with netbeans library manager

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Using .so and .dll with netbeans library manager

lobais
Hi, when I write programs using libraries, I normally uses netbeans
library manager to handle what libraries I need, and create a lib/
folder when I build the project.

Now I need a library container other kinds of files than .jar (.so
and .dll). When I add these to the library manager, I get some "not an
archive" error.

How is this supposed to be done?

--
Mvh. Thomas
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using .so and .dll with netbeans library manager

Marc Farrow
Don't think you can create a "library" in NetBeans for these types of libraries.  However, you should still be able to put them in the lib folder of your project and reference them there (probably via relative links).

On 4/20/06, Thomas Dybdahl Ahle <[hidden email]> wrote:
Hi, when I write programs using libraries, I normally uses netbeans
library manager to handle what libraries I need, and create a lib/
folder when I build the project.

Now I need a library container other kinds of files than .jar (.so
and .dll). When I add these to the library manager, I get some "not an
archive" error.

How is this supposed to be done?

--
Mvh. Thomas



--
Marc Farrow
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using .so and .dll with netbeans library manager

Alex Lam S.L.-2
It could be more of a Java problem, I think:

http://forum.java.sun.com/thread.jspa?threadID=563861&messageID=3123713

Alex.

On 4/20/06, Marc Farrow <[hidden email]> wrote:

> Don't think you can create a "library" in NetBeans for these types of
> libraries.  However, you should still be able to put them in the lib folder
> of your project and reference them there (probably via relative links).
>
>
> On 4/20/06, Thomas Dybdahl Ahle <[hidden email]> wrote:
> > Hi, when I write programs using libraries, I normally uses netbeans
> > library manager to handle what libraries I need, and create a lib/
> > folder when I build the project.
> >
> > Now I need a library container other kinds of files than .jar (.so
> > and .dll). When I add these to the library manager, I get some "not an
> > archive" error.
> >
> > How is this supposed to be done?
> >
> > --
> > Mvh. Thomas
> >
>
>
>
> --
> Marc Farrow
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using .so and .dll with netbeans library manager

lobais
tor, 20 04 2006 kl. 13:55 +0100, skrev Alex Lam S.L.:
> It could be more of a Java problem, I think:
Hmm... I've look through the (java) code of on the the libraries, and it
only looks for the .so/.dll files in the library, where the .jar is
located.

> On 4/20/06, Marc Farrow <[hidden email]> wrote:
> > Don't think you can create a "library" in NetBeans for these types of
> > libraries.  However, you should still be able to put them in the lib folder
> > of your project
Yes I do that, but then I have to move them there, every time I rebuild
the project... It works, but it is not a very pretty solution...

--
Mvh. Thomas
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using .so and .dll with netbeans library manager

Marc Farrow
if you put those libraries under web-inf folder it should move them for you.

On 4/20/06, Thomas Dybdahl Ahle <[hidden email]> wrote:
tor, 20 04 2006 kl. 13:55 +0100, skrev Alex Lam S.L.:
> It could be more of a Java problem, I think:
Hmm... I've look through the (java) code of on the the libraries, and it
only looks for the .so/.dll files in the library, where the .jar is
located.

> On 4/20/06, Marc Farrow <[hidden email]> wrote:
> > Don't think you can create a "library" in NetBeans for these types of
> > libraries.  However, you should still be able to put them in the lib folder
> > of your project
Yes I do that, but then I have to move them there, every time I rebuild
the project... It works, but it is not a very pretty solution...

--
Mvh. Thomas



--
Marc Farrow
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using .so and .dll with netbeans library manager

lobais
I made a folder: project folder/web-inf/ I put a file in it, but when I
did clean'n'build, projectfolder/dist/lib had no such file in it.

I guess I misunderstood something. Can you help me?

tor, 20 04 2006 kl. 09:39 -0400, skive Marc Farrow:

> if you put those libraries under web-inf folder it should move them
> for you.
>
> On 4/20/06, Thomas Dybdahl Ahle <[hidden email]> wrote:
>         tor, 20 04 2006 kl. 13:55 +0100, skrev Alex Lam S.L.:
>         > It could be more of a Java problem, I think:
>         Hmm... I've look through the (java) code of on the the
>         libraries, and it
>         only looks for the .so/.dll files in the library, where
>         the .jar is
>         located.
>        
>         > On 4/20/06, Marc Farrow <[hidden email]> wrote:
>         > > Don't think you can create a "library" in NetBeans for
>         these types of
>         > > libraries.  However, you should still be able to put them
>         in the lib folder
>         > > of your project
>         Yes I do that, but then I have to move them there, every time
>         I rebuild
>         the project... It works, but it is not a very pretty
>         solution...
>        
>         --
>         Mvh. Thomas
>
>
>
> --
> Marc Farrow
--
Mvh. Thomas
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using .so and .dll with netbeans library manager

Marc Farrow
It will be in projectfolder/build/web/web-inf/lib.
 
the dist folder will only contain the jar or war file for distributing.  if you inspect the jar/war, you will see the information under web-inf/lib folder.
 
 
 


 
On 4/20/06, Thomas Dybdahl Ahle <[hidden email]> wrote:
I made a folder: project folder/web-inf/ I put a file in it, but when I
did clean'n'build, projectfolder/dist/lib had no such file in it.

I guess I misunderstood something. Can you help me?

tor, 20 04 2006 kl. 09:39 -0400, skive Marc Farrow:
> if you put those libraries under web-inf folder it should move them
> for you.
>
> On 4/20/06, Thomas Dybdahl Ahle <[hidden email]> wrote:

>         tor, 20 04 2006 kl. 13:55 +0100, skrev Alex Lam S.L.:
>         > It could be more of a Java problem, I think:
>         Hmm... I've look through the (java) code of on the the
>         libraries, and it
>         only looks for the .so/.dll files in the library, where
>         the .jar is
>         located.
>
>         > On 4/20/06, Marc Farrow <[hidden email]> wrote:
>         > > Don't think you can create a "library" in NetBeans for
>         these types of
>         > > libraries.  However, you should still be able to put them
>         in the lib folder
>         > > of your project
>         Yes I do that, but then I have to move them there, every time
>         I rebuild
>         the project... It works, but it is not a very pretty
>         solution...
>
>         --
>         Mvh. Thomas
>
>
>
> --
> Marc Farrow
--
Mvh. Thomas



--
Marc Farrow
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using .so and .dll with netbeans library manager

lobais
tor, 20 04 2006 kl. 11:04 -0400, skrev Marc Farrow:
> It will be in projectfolder/build/web/web-inf/lib.

No such folder exists. projectfolder/build/ contains only classes/

> the dist folder will only contain the jar or war file for
> distributing.

Yes, but the .jar requires the .so/.dll to be in the same folder.

> if you inspect the jar/war, you will see the information under
> web-inf/lib folder.

How to "inspect" something?

>  
>  
>  
>
>
>  
> On 4/20/06, Thomas Dybdahl Ahle <[hidden email]> wrote:
>         I made a folder: project folder/web-inf/ I put a file in it,
>         but when I
>         did clean'n'build, projectfolder/dist/lib had no such file in
>         it.
>        
>         I guess I misunderstood something. Can you help me?
>        
>         tor, 20 04 2006 kl. 09:39 -0400, skive Marc Farrow:
>         > if you put those libraries under web-inf folder it should
>         move them
>         > for you.
>         >
>         > On 4/20/06, Thomas Dybdahl Ahle <[hidden email]> wrote:
>         >         tor, 20 04 2006 kl. 13:55 +0100, skrev Alex Lam
>         S.L.:
>         >         > It could be more of a Java problem, I think:
>         >         Hmm... I've look through the (java) code of on the
>         the
>         >         libraries, and it
>         >         only looks for the .so/.dll files in the library,
>         where
>         >         the .jar is
>         >         located.
>         >
>         >         > On 4/20/06, Marc Farrow <[hidden email]>
>         wrote:
>         >         > > Don't think you can create a "library" in
>         NetBeans for
>         >         these types of
>         >         > > libraries.  However, you should still be able to
>         put them
>         >         in the lib folder
>         >         > > of your project
>         >         Yes I do that, but then I have to move them there,
>         every time
>         >         I rebuild
>         >         the project... It works, but it is not a very pretty
>         >         solution...
>         >
>         >         --
>         >         Mvh. Thomas
>         >
>         >
>         >
>         > --
>         > Marc Farrow
>         --
>         Mvh. Thomas
>
>
>
> --
> Marc Farrow
--
Mvh. Thomas
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using .so and .dll with netbeans library manager

Marc Farrow
What type is your application?  Web or Java Library? 
 
To inspect your jar then do one of the following:
 
1) on windows use winzip or other archiver and check contents
2) jar -tf jarname
 
 


 
On 4/20/06, Thomas Dybdahl Ahle <[hidden email]> wrote:
tor, 20 04 2006 kl. 11:04 -0400, skrev Marc Farrow:
> It will be in projectfolder/build/web/web-inf/lib.

No such folder exists. projectfolder/build/ contains only classes/

> the dist folder will only contain the jar or war file for
> distributing.

Yes, but the .jar requires the .so/.dll to be in the same folder.

> if you inspect the jar/war, you will see the information under
> web-inf/lib folder.

How to "inspect" something?

>
>
>
>
>
>
> On 4/20/06, Thomas Dybdahl Ahle < [hidden email]> wrote:
>         I made a folder: project folder/web-inf/ I put a file in it,
>         but when I
>         did clean'n'build, projectfolder/dist/lib had no such file in
>         it.
>
>         I guess I misunderstood something. Can you help me?
>
>         tor, 20 04 2006 kl. 09:39 -0400, skive Marc Farrow:
>         > if you put those libraries under web-inf folder it should
>         move them
>         > for you.
>         >
>         > On 4/20/06, Thomas Dybdahl Ahle <[hidden email]> wrote:
>         >         tor, 20 04 2006 kl. 13:55 +0100, skrev Alex Lam
>         S.L.:
>         >         > It could be more of a Java problem, I think:
>         >         Hmm... I've look through the (java) code of on the
>         the
>         >         libraries, and it
>         >         only looks for the .so/.dll files in the library,
>         where
>         >         the .jar is
>         >         located.
>         >
>         >         > On 4/20/06, Marc Farrow < [hidden email]>
>         wrote:
>         >         > > Don't think you can create a "library" in
>         NetBeans for
>         >         these types of
>         >         > > libraries.  However, you should still be able to
>         put them
>         >         in the lib folder
>         >         > > of your project
>         >         Yes I do that, but then I have to move them there,
>         every time
>         >         I rebuild
>         >         the project... It works, but it is not a very pretty
>         >         solution...
>         >
>         >         --
>         >         Mvh. Thomas
>         >
>         >
>         >
>         > --
>         > Marc Farrow
>         --
>         Mvh. Thomas
>
>
>
> --
> Marc Farrow
--
Mvh. Thomas



--
Marc Farrow
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using .so and .dll with netbeans library manager

lobais
tor, 20 04 2006 kl. 11:41 -0400, skrev Marc Farrow:
> What type is your application?  Web or Java Library?  

A console webbrowser.

> To inspect your jar then do one of the following:
>  
> 1) on windows use winzip or other archiver and check contents
> 2) jar -tf jarname

Ah okay, but I've got no "web-inf" in my jar.

>  
>
>
>  
> On 4/20/06, Thomas Dybdahl Ahle <[hidden email]> wrote:
>         tor, 20 04 2006 kl. 11:04 -0400, skrev Marc Farrow:
>         > It will be in projectfolder/build/web/web-inf/lib.
>        
>         No such folder exists. projectfolder/build/ contains only
>         classes/
>        
>         > the dist folder will only contain the jar or war file for
>         > distributing.
>        
>         Yes, but the .jar requires the .so/.dll to be in the same
>         folder.
>        
>         > if you inspect the jar/war, you will see the information
>         under
>         > web-inf/lib folder.
>        
>         How to "inspect" something?
>        
>         >
>         >
>         >
>         >
>         >
>         >
>         > On 4/20/06, Thomas Dybdahl Ahle < [hidden email]> wrote:
>         >         I made a folder: project folder/web-inf/ I put a
>         file in it,
>         >         but when I
>         >         did clean'n'build, projectfolder/dist/lib had no
>         such file in
>         >         it.
>         >
>         >         I guess I misunderstood something. Can you help me?
>         >
>         >         tor, 20 04 2006 kl. 09:39 -0400, skive Marc Farrow:
>         >         > if you put those libraries under web-inf folder it
>         should
>         >         move them
>         >         > for you.
>         >         >
>         >         > On 4/20/06, Thomas Dybdahl Ahle <[hidden email]>
>         wrote:
>         >         >         tor, 20 04 2006 kl. 13:55 +0100, skrev
>         Alex Lam
>         >         S.L.:
>         >         >         > It could be more of a Java problem, I
>         think:
>         >         >         Hmm... I've look through the (java) code
>         of on the
>         >         the
>         >         >         libraries, and it
>         >         >         only looks for the .so/.dll files in the
>         library,
>         >         where
>         >         >         the .jar is
>         >         >         located.
>         >         >
>         >         >         > On 4/20/06, Marc Farrow <
>         [hidden email]>
>         >         wrote:
>         >         >         > > Don't think you can create a "library"
>         in
>         >         NetBeans for
>         >         >         these types of
>         >         >         > > libraries.  However, you should still
>         be able to
>         >         put them
>         >         >         in the lib folder
>         >         >         > > of your project
>         >         >         Yes I do that, but then I have to move
>         them there,
>         >         every time
>         >         >         I rebuild
>         >         >         the project... It works, but it is not a
>         very pretty
>         >         >         solution...
>         >         >
>         >         >         --
>         >         >         Mvh. Thomas
>         >         >
>         >         >
>         >         >
>         >         > --
>         >         > Marc Farrow
>         >         --
>         >         Mvh. Thomas
>         >
>         >
>         >
>         > --
>         > Marc Farrow
>         --
>         Mvh. Thomas
>
>
>
> --
> Marc Farrow
--
Mvh. Thomas
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using .so and .dll with netbeans library manager

Marc Farrow
I was asking what type of project is defined in NetBeans for this application?
 


 
On 4/20/06, Thomas Dybdahl Ahle <[hidden email]> wrote:
tor, 20 04 2006 kl. 11:41 -0400, skrev Marc Farrow:
> What type is your application?  Web or Java Library?

A console webbrowser.

> To inspect your jar then do one of the following:
>
> 1) on windows use winzip or other archiver and check contents
> 2) jar -tf jarname

Ah okay, but I've got no "web-inf" in my jar.

>
>
>
>
> On 4/20/06, Thomas Dybdahl Ahle <[hidden email]> wrote:
>         tor, 20 04 2006 kl. 11:04 -0400, skrev Marc Farrow:
>         > It will be in projectfolder/build/web/web-inf/lib.
>
>         No such folder exists. projectfolder/build/ contains only
>         classes/
>
>         > the dist folder will only contain the jar or war file for
>         > distributing.
>
>         Yes, but the .jar requires the .so/.dll to be in the same
>         folder.
>
>         > if you inspect the jar/war, you will see the information
>         under
>         > web-inf/lib folder.
>
>         How to "inspect" something?
>
>         >
>         >
>         >
>         >
>         >
>         >
>         > On 4/20/06, Thomas Dybdahl Ahle < [hidden email]> wrote:
>         >         I made a folder: project folder/web-inf/ I put a
>         file in it,
>         >         but when I
>         >         did clean'n'build, projectfolder/dist/lib had no
>         such file in
>         >         it.
>         >
>         >         I guess I misunderstood something. Can you help me?
>         >
>         >         tor, 20 04 2006 kl. 09:39 -0400, skive Marc Farrow:
>         >         > if you put those libraries under web-inf folder it
>         should
>         >         move them
>         >         > for you.
>         >         >
>         >         > On 4/20/06, Thomas Dybdahl Ahle <[hidden email]>
>         wrote:
>         >         >         tor, 20 04 2006 kl. 13:55 +0100, skrev
>         Alex Lam
>         >         S.L.:
>         >         >         > It could be more of a Java problem, I
>         think:
>         >         >         Hmm... I've look through the (java) code
>         of on the
>         >         the
>         >         >         libraries, and it
>         >         >         only looks for the .so/.dll files in the
>         library,
>         >         where
>         >         >         the .jar is
>         >         >         located.
>         >         >
>         >         >         > On 4/20/06, Marc Farrow <
>         [hidden email]>
>         >         wrote:
>         >         >         > > Don't think you can create a "library"
>         in
>         >         NetBeans for
>         >         >         these types of
>         >         >         > > libraries.  However, you should still
>         be able to
>         >         put them
>         >         >         in the lib folder
>         >         >         > > of your project
>         >         >         Yes I do that, but then I have to move
>         them there,
>         >         every time
>         >         >         I rebuild
>         >         >         the project... It works, but it is not a
>         very pretty
>         >         >         solution...
>         >         >
>         >         >         --
>         >         >         Mvh. Thomas
>         >         >
>         >         >
>         >         >
>         >         > --
>         >         > Marc Farrow
>         >         --
>         >         Mvh. Thomas
>         >
>         >
>         >
>         > --
>         > Marc Farrow
>         --
>         Mvh. Thomas
>
>
>
> --
> Marc Farrow
--
Mvh. Thomas



--
Marc Farrow
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using .so and .dll with netbeans library manager

lobais
tor, 20 04 2006 kl. 12:30 -0400, skrev Marc Farrow:
> I was asking what type of project is defined in NetBeans for this
> application?

ah okay :D
It's a Java Application

--
Mvh. Thomas
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using .so and .dll with netbeans library manager

Marc Farrow
Ok I seem to have lost the rest of the this thread, but I believe my thinking was wrong because I was on a Web Application kick.  Sorry for the confusion.
 
I just did this test and it worked.  You might have to change your relative links around, but give it a go.
 
Go to your "src" folder and add a new folder under it called lib (or you can even leave the folder out).
 
Copy your "DLLs and other favorite non-java stuff" into this folder or the "src" folder.
 
When you build your project all the information will be included in your jar.
 
Viola!  You have your "other" content deployed within your Jar file and the Java code running from the Jar file should be able to find those resources.
 
HTH.

 
On 4/20/06, Thomas Dybdahl Ahle <[hidden email]> wrote:
tor, 20 04 2006 kl. 12:30 -0400, skrev Marc Farrow:
> I was asking what type of project is defined in NetBeans for this
> application?

ah okay :D
It's a Java Application

--
Mvh. Thomas



--
Marc Farrow
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using .so and .dll with netbeans library manager

lobais
tor, 20 04 2006 kl. 13:19 -0400, skrev Marc Farrow:
> Viola!  You have your "other" content deployed within your Jar file
> and the Java code running from the Jar file should be able to find
> those resources.

Of course you are right, the problem just was, that the library was
searching in dist/lib and not in dist/file.jar.

I'll probably have to make a shellscript that copies all the .so files
to dist/lib, and runs the jar. That way it will still only require one
click. I will still have problems every time I use the libraries in a
new project, but maybe something will be fixed in netbeans 5.5 or 6.0...

--
Mvh. Thomas
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Using .so and .dll with netbeans library manager

David Grace-2
Hi,

If I understand your problem it is very simple to add to the ant built
task to copy any file to anywhere else you want. For instance adding to
build.xml:

<target name="-post-jar">
        <copy file="xxx.dll" toFile="xxx.dll"/>
</target>

Dave.

-----Original Message-----
From: Thomas Dybdahl Ahle [mailto:[hidden email]]
Sent: Friday, 21 April 2006 3:33 AM
To: [hidden email]
Subject: Re: [nbusers] Using .so and .dll with netbeans library manager

tor, 20 04 2006 kl. 13:19 -0400, skrev Marc Farrow:
> Viola!  You have your "other" content deployed within your Jar file
> and the Java code running from the Jar file should be able to find
> those resources.

Of course you are right, the problem just was, that the library was
searching in dist/lib and not in dist/file.jar.

I'll probably have to make a shellscript that copies all the .so files
to dist/lib, and runs the jar. That way it will still only require one
click. I will still have problems every time I use the libraries in a
new project, but maybe something will be fixed in netbeans 5.5 or 6.0...

--
Mvh. Thomas
--
Message protected by MailGuard: e-mail anti-virus, anti-spam and content
filtering.
http://www.mailguard.com.au/mg





--
Message protected by MailGuard: e-mail anti-virus, anti-spam and content filtering.
http://www.mailguard.com.au/mg

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Using .so and .dll with netbeans library manager

lobais
Nice :D
I have never really looked into ant. It seams that there may be a whole
world awaiting. :)
The lines did there job perfectly, even when I will still have to add
such lines to every project using the library.

--
Best Regards, Thomas

fre, 21 04 2006 kl. 10:26 +1000, skrev David Grace:

> Hi,
>
> If I understand your problem it is very simple to add to the ant built
> task to copy any file to anywhere else you want. For instance adding to
> build.xml:
>
> <target name="-post-jar">
> <copy file="xxx.dll" toFile="xxx.dll"/>
> </target>
>
> Dave.
>
> -----Original Message-----
> From: Thomas Dybdahl Ahle [mailto:[hidden email]]
> Sent: Friday, 21 April 2006 3:33 AM
> To: [hidden email]
> Subject: Re: [nbusers] Using .so and .dll with netbeans library manager
>
> tor, 20 04 2006 kl. 13:19 -0400, skrev Marc Farrow:
> > Viola!  You have your "other" content deployed within your Jar file
> > and the Java code running from the Jar file should be able to find
> > those resources.
>
> Of course you are right, the problem just was, that the library was
> searching in dist/lib and not in dist/file.jar.
>
> I'll probably have to make a shellscript that copies all the .so files
> to dist/lib, and runs the jar. That way it will still only require one
> click. I will still have problems every time I use the libraries in a
> new project, but maybe something will be fixed in netbeans 5.5 or 6.0...
>
> --
> Mvh. Thomas
> --
> Message protected by MailGuard: e-mail anti-virus, anti-spam and content
> filtering.
> http://www.mailguard.com.au/mg
>
>
>
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Using .so and .dll with netbeans library manager

Jyothsna
In reply to this post by lobais
Hi thank you  very much .Actually i am facing problem regarding to dll files .Ur information is useful for me.finally it works thank you
Loading...