Results 1 to 9 of 9
  1. #1
    IYIaster is offline Member
    Join Date
    Jul 2009
    Posts
    46
    Rep Power
    0

    Default import library into netbeans.

    I've imported a library into my netbeans application. When doing this it created a new package called "sigar-bin" Now the application I have works fine using this package as a folder and just sending the command to the jar, but now I want it to all be one application. This is the command I used when it was just a folder and not part of the application.

    Java Code:
    String command = "java.exe -jar sigar-bin/lib/sigar.jar cpuinfo";
    My question is now that it is a package what command would I run to get the same effect. I tried importing the package into my class but it will not let me.
    Thanks for the help.

  2. #2
    IYIaster is offline Member
    Join Date
    Jul 2009
    Posts
    46
    Rep Power
    0

    Default

    I know this is simple someone please help

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    If I'm correct what you want to do is, once you build the application in dist folder you can see more than one files (actually additional libraries are placed inside lib folder within that dis folder) and you want to create a single jar file using those. Am I correct?

  4. #4
    IYIaster is offline Member
    Join Date
    Jul 2009
    Posts
    46
    Rep Power
    0

    Default

    Yes, but I will be a java web applet. So, everything will have to be inside the one application.

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Still you can create a single Jar file, but not with NetBeans. Unfortunatly NetBeans keep that folder structure still when building the application.

    So you've to do it manually. Please read Suns' tutorial about Java Packaging.

    Lesson: Packaging Programs in JAR Files (The Java™ Tutorials > Deployment)

  6. #6
    IYIaster is offline Member
    Join Date
    Jul 2009
    Posts
    46
    Rep Power
    0

    Default

    Well, when I imported the package into netbeans. It did import it my jar went from 500kb to 4000kb so it is importing it into the application.

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Quote Originally Posted by IYIaster View Post
    Well, when I imported the package into netbeans. It did import it my jar went from 500kb to 4000kb so it is importing it into the application.
    I'm not clear what you mean here.

    Now you have a jar file, with additional files, right? And do you want to import them into another application/project and use?

  8. #8
    IYIaster is offline Member
    Join Date
    Jul 2009
    Posts
    46
    Rep Power
    0

    Default

    Yes I have a application called sigar.jar. Not sure if you have ever heard of it. Home - Sigar - Confluence
    I need to import this so that I can feed it commands and get system information.
    I've already imported it into my application and it came up as a package called sigar-bin and has two package inside of it include and lib and there are alot of files inside of those package. in the lib package sigar.jar is located here and this is what I need to send the commands to so that I can gather the information that I need

  9. #9
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Okay you've an extra/additional jar file you want to use in your application. You said that already import into your application. So now it's matter of work around with that, it should have a documentation I guess.

    After you build your application, defenetly you comes with a large Jar file. So why you bother on that. It should have couple of files within the dist folder because you use some additional files. If you want to use them as a single Jar file, then manually you've to do that.

Similar Threads

  1. Netbeans not recognizing library
    By ehsen in forum NetBeans
    Replies: 16
    Last Post: 08-30-2009, 05:32 PM
  2. Import files from NetBeans
    By Juuno in forum Eclipse
    Replies: 2
    Last Post: 04-08-2009, 05:20 AM
  3. How could i import DLL in NetBeans?
    By makpandian in forum NetBeans
    Replies: 0
    Last Post: 02-13-2009, 12:53 PM
  4. can any one help?? how to import library
    By libish in forum New To Java
    Replies: 5
    Last Post: 02-12-2009, 06:51 AM
  5. Tell me jar file for library library org.bouncycastle.cms
    By 82rathi.angara in forum New To Java
    Replies: 10
    Last Post: 09-09-2008, 05:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •