Netbeans 4.1 packaging libraries

I just started using netbeans 4.1 from 3.6 and I have trouble adding
external 3rd party classes/jars/resources into my jar distribution. I
can add them the the libraries for the project, but it doesnt add the
needed classes into the dist/myprogram.jar. Anyone know how to add that? In 3.6 I could manually mount the jar and add the classes I needed from within it directly to the distribution.

The default project run settings in NB 4.1 use the "compile-time libraries" before they check recently compiled sources. If you have an old version of the file you are trying to run in a .jar file somewhere in your compile-time libraries NetBeans will use that file. If that old file does not have a main method you will get the error you mentioned.
You will be able to compile your class because when compiling NetBeans will work on changed files and only access the compile-time libraries when needed.
The new project will have no old .jars in its path so you will not run into this conflict.
I would first try to remove the old copy of your file from the compiling sources path.
If you can't remove the file try reordering the project�s libraries listed under project properties -> libraries-> �run� tab so that your �compiling sources� are listed before your "classpath for compiling sources"
-Mark

Similar Messages

  • NetBeans and j2sdk package hangs when installing

    When installing the netbeans 3.6 and j2sdk package the installer get to 48 % and hangs. I let is sit all night and it was still the same the next morning. I am running on XP professional. Any ideas on how to get it to install.
    Thanks
    Randy

    I was having a similar problem
    I originally installed the combined package netbeans 5.5 with JDK 1.5.0.9 with no problems.
    Unfortunately, I had to uninstall Netbeans, because the Nokia Carbide_j_1_5 integrated plug-in broke it. However, after uninstalling just Netbeans, I was unable to reinstall it !
    The installer would report that the JDK was already installed and that it would just install Netbeans 5.5. At that point I clicked "next" to continue, but the installer just hung.
    After many attempts, I finally found this thread, and decided to try downloading the installer for just Netbeans (netbeans-5_5-windows.exe)
    Bingo! It installed fine. So now I can go home. What a way to spend a Friday night!

  • Using pacman to search for packages - libraries no more used / needed

    Is there a way to use pacmant to "clean out" the system, by searcing and deleting all packages and libraries no more needed nor used by anything?

    Are you looking for options different from these? http://bbs.archlinux.org/viewtopic.php?id=88987
    I don't think there's a completely automatic way. At least, not a way that I would trust.
    Last edited by drcouzelis (2010-01-22 16:42:31)

  • NetBeans Problem with package, pls help.....

    Hi all, I have a package problem. With the following 2 classes, I can compile fine in dos with
    c:\java> javac WapDev3\*.java
    but wont compile in Netbeans 3.4 Pls help.
    The classes are
    -------------------class sample1 at c:\java\WapDev3------------------
    package WapDev3;
    class sample1 {
    public sample1() {
    System.out.println("hi");
    --------------------class sample2 at c:\WapDev3------------------
    package WapDev3;
    class sample2 {
    public sample2() {
    public static void main(String[] args) {
    sample1 osample1 = new sample1();

    I don't know for certain whether this is causing your problem, but in Netbeans, the package structure is considered to be identical to the directory structure, relative to the mountingpoint, so if your files are in java/wapdev, Netbeans wants you to make the package java/wapdev.
    This can be cured by mounting a subdirectory, using a relative mounting point.
    In your case, you should mount C:\java (I assume you've mounted C:\).
    Good luck.

  • Netbeans org.openide package problem

    Hi,
    I wanted to set a menemonic for the menu with an '&Something'
    Netbeans asked me to import some package to what I naively agreed,
    but as it happens I don't have that package on my computer so the problem
    is that the program(s) don't compile because Netbeans adds this non-existing
    package to every new project I make !! and I can't run windowed applications anymore,
    Please help me, how to tell Netbeans to not include this package ???

    It took so long because I had to switch computers with
    another Neatbeans instalation but the solution is:
    "You can later turn this option on or off. Choose Tools | Options. Expand the
    Editing node, and select Form Editor Settings. Then change the Generate
    Mnemonics Code property."

  • Packaging libraries in EAR

    Hello,
    My J2EE app uses an external library, let's call it ExtLibrary. So, MyApp.ear contains MyEJBs.jar and ExtLibrary.jar.
    My EJB produces ClassNotFoundException because it doesn't find a class located in ExtLibrary.jar.
    Where should I place the ExtLibrary.jar in the EAR?
    What should I do to link MyEJBs.jar with ExtLibrary.jar?
    Thanks for your help,
    Gerald

    This packaging issue is covered in the J2EE platform spec (section 8.2 Optional Package Support), located here: http://java.sun.com/j2ee/1.4/download.html#platformspec
    The basic idea is to use the Class-Path attribute in the manifest file of your EJB archive to point at your library jar (all packaged in the same application archive - ear file). J2EE platforms must support this feature. There are some good examples in the platform spec that demonstrate this feature.

  • Using libraries in NetBeans 6.1

    Suppose you have two classes that are in separate files but the same package. In order for one class to access the other that it references that is in the same package, what do you need to do? What I did was add the project that contains the referenced class to the Libraries folder (listed under the Projects tab) that's inside the file in which its referenced. I don't understand why I needed to do this since both classes are in the same package (and in the same directory). I believe I created the project files correctly because for each file I selected New Project, then Class Library, and I clicked on the Source Packages tab under the Projects tab and added a new Java package...The code for the two classes are listed below (Note, I don't know if this would make a difference, but the IDE I used is NetBeans 6.1):
    //: innerclasses/controller/Event.java
    // The common methods for any control event.
    package innerclasses.controller;
    public abstract class Event {
      private long eventTime;
      protected final long delayTime;
      public Event(long delayTime) {
        this.delayTime = delayTime;
        start();
      public void start() { // Allows restarting
        eventTime = System.nanoTime() + delayTime;
      public boolean ready() {
        return System.nanoTime() >= eventTime;
      public abstract void action();
    } ///:~
    //: innerclasses/controller/Controller.java
    // The reusable framework for control systems.
    package innerclasses.controller;
    import java.util.*;
    public class Controller {
      // A class from java.util to hold Event objects:
      private List<Event> eventList = new ArrayList<Event>();
      public void addEvent(Event c) { eventList.add(c); }
      public void run() {
        while(eventList.size() > 0)
          // Make a copy so you're not modifying the list
          // while you're selecting the elements in it:
          for(Event e : new ArrayList<Event>(eventList))
            if(e.ready()) {
              System.out.println(e);
              e.action();
              eventList.remove(e);
    } ///:~Similarly, how do you import the library innerclasses.controller other than writing "import innerclasses.controller;?" I did the same as listed above (adding the two project files above that are from the same package to the Libraries folder that's inside the file).
    Thanks in advance!

    hi it is unlikely people will answer you here because it is about netbeans. this is a java site so they will probably tell you to go to a netbeans site. the one i use is nabbles netbeans just do a search on google to find it.
    you might get lucky here but i doubt it because most people here use notepad and run programs from command prompt. so they might not even know anyway. also i think there is a tutorial at the netbeans sites about transfering libraries they tell you how in some of the introductory tutorials. i think one of the tutorials in relation to setting up a database using derby shows you how to do it but i can't remember.
    your best bet is nabble good luck.

  • Netbeans and hibernate

    I created a netbeans project .Netbeans uses nbxdoclet for hibernate.
    I created the bean in hibernate .Netbeans generated Util file and facade file(in which i specify my function).
    It is working.
    Now I want to add date in existing table.
    But the problem is whenever I try to add date in an existing bean using hibernate property feature.
    I dont get date as a datatype??
    Any suggestions?
    Thankyou in advance.

    Well, it seems like most of you simply read the
    various texts and try the vendors' examples. I'm
    surprised that no one mentioned ever having bought a
    prototype application from the onset. "bought"? What's that mean? You don't buy prototypes. You download evaluation versions, maybe.
    I try to find sample code and tweak it to see the effects. Otherwise, I start writing small sample code an build on that.
    I consider myself a reasonably competent core Java
    programmer, but I had serious difficulty configuring
    and merging its related technologies. There were so
    many disjointed pieces of instructional information
    that the additional research time really hurt our
    budget severely. Not an uncommon thing, I'm sure. There's a lot of stuff. But don't bother learning all of it. Not in detail, at least. It's a good idea to familiarize yourself with the names of packages/libraries and what they do. But only really learn what you need to learn for what you need to do. The next project you will probably need other things, so you learn them then.
    bsampieri,
    I've setup Tomcat and tried the examples--in fact, I
    normally follow tutorials for all products I hope to
    use. Problem is, the examples and tutorials never
    address my specific needs. So, I usually inch toward
    my goal by spending weeks or months in forums to
    continue where the tutorials leave off. Anything complex is going to not be there.... the trick is to identify pieces that you can pull out to build more complex apps. And the fact that JSP/servlets have the issue of being compounded by all the HTML/CSS/JS and HTTP protocol ... I don't want to say limitiations, exactly... Well, it just makes things more complex and harder to know what you need.
    Perhaps you guys are much faster and smarter than
    I...or you have a much bigger budget :)Probably not... on either account.

  • Jaxws21 library missing from NetBeans 6

    I recently installed the NetBeans IDE 6.0 ("All" package). I used it to create a Web Service from a Java class and successfully deployed the service to GlassFish V2. I then attempted to create a Java class in a Java SE application to consume the service. After choosing New > Web Service Client and selecting the web service I kept getting the error:
    init:_
    wsimport-init:_
    C:\Documents and Settings\536116\My Documents\NetBeansProjects\Test_Application\nbproject\jaxws-build.xml:11:_
    taskdef class com.sun.tools.ws.ant.WsImport cannot be found_
    BUILD FAILED (total time: 0 seconds)_
    The jaxws-tools.jar contains the WsImport tool and that jar file was in <NetBeans install dir>\java1\modules\ext\jaxws21
    The only way that I managed to create and compile the web services client was to create a new library in NetBeans, name it 'jaxws21', add the jaxws-tools.jar and then add the jaxws21 library to the project. Did I miss something in the installation process? Also, because I wasn't sure what should be in jaxws21, I added the jaxws-rt.jar, as well as the jaxws-tools.jar when I created the library. Are those the 2 jars that should be in jaxws21? Is there a way to not have to manually add the jaxws21 library each time I create a new Web Service client?

    I think there's more to it than that... The reason I think so is that I just ran into this same issue on my notebook - but I am using a MacBook Pro running MacOSX 10.5.2, and the only version of Java installed on this machine is JDK 1.5 from Apple...
    Interestingly enough, NetBeans 6 won't let me choose files inside the NetBeans folder to create libraries with ... So I will have to try your solution, once I download a standalone version of JAX-WS to my Mac...
    Moises

  • Package javax.servlet does not exist

    Trying to learn servlets. just installing software & tesing install.
    What I have done:
    1. read Deitel text, and written & tested applications and applets..even on my web site. surprise surprise.
    2. installed J2Std Edition and did applications & applets.
    3. Wanted to do servlets so downloaded and installed TOMCAT(got their index html so looks like it is at least running).
    4. Took Deitel servlet pgm example and tried to compile, but got the subject msg and others concening methods i expect to be in the include.
    5. After reading lots decided maybe I need to install J2EE to do servlets(I dont see where Deitel tells me I need to do this).
    6. Went to SUN, downloaded and installed J2EE. Im on NT 4.0 so I set JAVA_HOME and J2EE_HOME.
    7. Read topics this forum, so I found servlet.jar in my TOMCAT dir, copied it to jdk1.3.1\jre\bin and jdk1.3.1\jre\lib.
    8. set CLASSPATH to one of these.
    9 STILL get the error. I appreciate any help you can give. Im very new to SUN and am just blindly trying to follow what Dietel tells me to do. I love the JAVA part of the text, but the way they explain the software installs is very poor.
    The jar file is listed as an executable, so I assume I dont need to do any type of unpacking like with a zip file. A puzzle to me is that the text talks about the INCLUDE stmts pointing to directory structurs/file names, but I cant find many of them.. they mmust be hidden in some other pack files I guess because all applications and applets are compiling and running just fine.
    I there any documentation(at SUN or elsewhere) that kind of explains in English to the uninitiated how the different SUN products/packages work together/seperately.. when each one is necessary??
    Thanks for your help [email protected]

    Grayman,
    An application server like Tomcat needs access to a java runtime environment and all the libraries referenced from the application code that you deploy on it.
    So maybe try debugging like this :
    1)first check all your imports in the code
    especially
    import javax.servlet.*;
    import javax.servlet.http.*;
    2) Browse trough the tomcat documentation to see which runtime environment it is running on top of. This could be something like C:\JDK1.2\.. but could be also be C:\program files\java\JDK1.2\.. or
    even (I dont know Tomcat very well) c:\Program Files\Tomcat\bin\Jdk1.2\
    3) Once you have found which is the runtime environment for your application server, you can assume that all .jar-packaged libraries in ...\JDK1.2\lib\ are available to your code. So you could copy servlets.jar to that directory.
    4) make sure to restart Tomcat.
    if you want to check which Classes are available in a .jar - file, do this: 1)open a dos prompt 2)Set PATH=%PATH%;C:\...\JDK1.2\bin (i.e include the jar-utility) as a command line program
    3)cd to the directory where the .jar-file can be found (ex: C:\JDK1.2\lib\rt.jar)
    4) type: jar -tvf rt.jar
    you should see the content on your screen
    java.awt.Textbox.class
    java.awt. etc..
    good luck
    Papyrus

  • Jstl.jar and standard.jar in NetBeans

    how can i put jstl.jar, standard.jar in library folder and how can i run that in same ide???

    Which version of NetBeans are you using?
    In general though, you should be able to expand the NetBeans project, select the Libraries folder, right-click on it, select 'Add Jar/File...' option and add any jar to the library list for the project.
    Another method is to define a library by 'Tools | Library Manager | New Library | Name the library and click OK | add the jars you want to be part of the named library'. Once a library is defined, then select 'Add Library...' on the right-click menu of the Libraries folder of a project and add the named library from the library manager. This should add all the jars that are part of the named library to the project.
    In NetBeans 5.5, JSTL 1.1 is a pre-defined library. You should be able to select that from the library manager and add to any project.

  • Package Packet Tracer 6.0.1.exe for native for Mac OS X

    Hello everyone, share a way to package Packet Tracer.exe possibly any .exe to a native app on Mac OS X with WineSkin.
    You can download the Packet Tracer 6.0.1 for windows and WineSkin from here:
    Download Packet Tacer 6.0.1
    Download WineSkin
    After download and install WineSkin is necessary to download certain Engines and Wrappers that allow you to run windows on mac and itself packaging libraries. The Engines that must install are:
    WS9Wine1.5.27
    WS9Wine1.5.2AMDSpeedHack
    The Wrapper that we will use is:
    WineSkin-2.5.12
    For the following steps you can follow this tutorial video made by my
    http://rafavg77.wordpress.com/2013/09/07/como-empaquetar-packet-tracer-exe-a-una -app-nativa-en-mac-os-x/
    Any question or observation I am open to comments. Best regards.

    hi,
    i have already followed all your instructions and after after many times, i was stuck at the same place.
    i want to click the icon so that i can "install this software" but the dialog box opened and "Cisco Packet Tracer 6.0.1 can't be open"
    i really hope you saw my message and please guide me on how to proceed.
    thanks!

  • Designing GUI in NetBeans 6.1

    I have some forms with JTextFields, JButtons and JLabels.
    I have a very annoying problem in the NetBeans 6.1, that sometimes if I change the location of one of the components in the form (in the design view), for example a JTextField, the entire form changes its look - buttons are moving, labels are dissappearing etc.
    Why is that? Is it a bug in the IDE?

    hi it is unlikely people will answer you here because it is about netbeans. this is a java site so they will probably tell you to go to a netbeans site. the one i use is nabbles netbeans just do a search on google to find it.
    you might get lucky here but i doubt it because most people here use notepad and run programs from command prompt. so they might not even know anyway. also i think there is a tutorial at the netbeans sites about transfering libraries they tell you how in some of the introductory tutorials. i think one of the tutorials in relation to setting up a database using derby shows you how to do it but i can't remember.
    your best bet is nabble good luck.

  • J2ME/CDC and Netbeans

    Hi all,
    I am compiling some code in Netbeans using the CDC libraries and I am getting
    this:
    Compiling 20 source files to C:\build\compiled
    C:\CP\ControlPanel.java:56: generics are not supported in -source 1.4
    (try -source 1.5 to enable generics)
    The only Java platforms I have in there are CDC and J2SE 1.5 - why does the compilation keep
    referring to 1.4 as source? Furthermore, let's say for some reason it does, how does one
    change this?
    Thanks much

    Hi all,
    I am compiling some code in Netbeans using the CDC libraries and I am getting
    this:
    Compiling 20 source files to C:\build\compiled
    C:\CP\ControlPanel.java:56: generics are not supported in -source 1.4
    (try -source 1.5 to enable generics)
    The only Java platforms I have in there are CDC and J2SE 1.5 - why does the compilation keep
    referring to 1.4 as source? Furthermore, let's say for some reason it does, how does one
    change this?
    Thanks much

  • Integrate J2ME Polish in NetBeans environment

    Hi all,
    I've trouble with having a full functionnal Netbeans environment with J2ME Polish.
    Here are the two ways I've tried without full success :
    *1- Start from a J2ME Polish project sample :*
    The sample is working well and when I add my code, most of it is working but :
    -> I can't add my own ressources (icons, sounds, etc...) even by adding the ressource directory in project properties. The code doesn't find them at execution.
    -> It doesn't find some specific APIs like MMAPI javax.microedition.media.control.VideoControl even if MMAPI ability is present and even if I manually add the mmapi.jar file in the library&ressources.
    *2- Add Polish library to an existing and working project :*
    I've added Polish abilities and enough-j2mepolish-client.jar library
    The code is compiling and I have access to both Polish and MMAPI interfaces.
    -> The big problem is that polish screens are empty. For example a simple polish alert screen is empty, the title bar is displayed, the softkeys are displayed but the content is not. Whereas, the string to be displayed is correctly built and no exception is raised during screen building and display.
    So my question is : Is there anybody who has a correct Netbeans 6.0.1 environment including J2ME Polish and what are the steps to follow to build such an environment ?
    Thanks a lot

    First of all , install netbeans and mobility package.
    Then do the follows:
    http://www.j2mepolish.org/docs/install.html#netbeans5
    J2ME Polish provides NetBeans specific build scripts from J2ME Polish 1.3 Beta 3 onwards. You can now just open any of the provided sample applications, delete the default build.xml script and rename the build-netbeans.xml script to build.xml. You can from then on use the normal debugging, build and compile facilities of NetBeans.
    Integrating a sample application in NetBeans:
    Select File > Open Project... and select any sample application in ${polish.home}/samples. Just select a folder like the menu folder and select Open.
    Now switch to the Files window by selecting Window > Files.
    In this window delete or rename the build.xml script which is in the base folder of the project.
    Now right-click the build-netbeans.xml script and rename it to build.xml. When the renaming does not work, do it directly from the file system (e.g. Windows Explorer).
    From now on you can build, run, debug and compile with the normal NetBeans commands (e.g. F5 for debugging). J2ME Polish is then used for building etc.
    When you start a new project in NetBeans, just copy one of the sample build.xml scripts to your project's folder. Then adjust the settings according to your needs.
    So , just adjust the ant script 'build.xml'

Maybe you are looking for

  • LMS 4.0 not starting after upgrade

    I am running LMS 4.0 on Windows 2008 Server, recently changed from eval copy to licensed (for 750 devices). It had been running and working for several months.The license application worked fine and it ran a couple days that way. I then downloaded th

  • Plz help me design this query

    Hi, Can you'll please help me with this query. Here is a little bit of background: One title can have multiple items associated with it. Table: TITLE has the master list of titles. TITLE_ID is the primary key. Table: ITEM has the master list of all i

  • SSIS Expressions Problem

    Hi All, Please help on the SSIS issue. i have a package.It contains Foreach loop container,Inside foreach loop container,I have one Dataflow task(Inside dataflow task,i am using Oledb source(table),I am populating  Data into Flat file)with flat file

  • Is Adobe Photoshop Elements 8 & Adobe Premiere Elements 8 suitable for creating movies with sound?

    Hi Here is what I want to do:         make a movie of me teaching a class and put in online         (for an online course is one use);         be able to edit video;         add photos in;         create podcasts and export say to mp3 and other types

  • Putting a byte array on the stack

    Hi, How do you allocate a local variable (eg a byte[]) on the machine's stack instead of allocating memory on the heap ? To clarify my question: void foo()    byte[] theArray = new byte[5]; }C equivalent: void foo(void)    u_8* theArray = getmem(5);