How  to include the inner classes in a jar file in netbeans ide

Dear java friends
how to say to netbeans ide that it has to include the
inner classes in the jar file.
(i have one single applet class
with two inner classes that show up
in the build/classes file but not in the jar).
The applet works in the viewer but not
in the browser (I believe because the
xxx$yyy etc should be in the jar)
willemjav

First, please stop posting the same question multiple times:
Duplicate of http://forum.java.sun.com/thread.jspa?threadID=5269782&messageID=10127496#10127496
with an answer.
Second, If your problem is that you can't do this in NetBeans, you need to post to somewhere that provides NetBeans support - like the NetBeans website's mailing list. These forums do not support NetBeans (or any other IDE) - they are Java language forums.

Similar Messages

  • How do I list all classes in a Jar file?

    How do I list all classes in a Jar file?

    Its no problem if the jar file contains classes, but I have an EAR file, which contains a jar-file, and I want to list all classes in that jar-file.
    I would like to do something like this:
    java.util.jar.JarFile jarfile = new java.util.jar.JarFile( new File("/meYear.ear"), true );
    java.util.jar.JarEntry jar = jarfile.getJarEntry( "myJar.jar" );
    // Cast it to a new JarFile:
    java.util.jar.JarFile newJar = (java.util.jar.JarFile)jar;
    But the method getEntry returns something like jarFile$JarEntry, if I try to class cast it I get an classCastException.

  • Calling functions of the inner class in .java code file

    Hello,
    I created a .java code file in Visual J#.Net and converted it into
    the application by adding the "public static void main(String args[])"
    function.
    I have created the two classes one extends from Applet, and the other
    extends from Frame. The class which I inherited from the Frame class becomes
    the inner class of the class extended from the Applet. Now How do I
    call the functions of the class extended from Frame class - MenuBarFrame
    class. the outline code is
    public class menu_show extends Applet
    ------init , paint action function---------
    public class MenuBarFrame extends Frame
    paint,action function for Menu
    public static void main(String args[])
    applet class instance is created
    instance of frame is created
    Menu , MenuBar, MenuItem instance is created
    and all these objects added
    I have Created MenuBarFrame class instance as
    Object x= new menu_show().new MenuBarFrame
    ????? How to call the functions such as action of MenuBarFrame class - what
    should be its parameters??????
    }

    Here's how I would do it:
    interface Operation {
        public int op(int y);
    class X {
        private int x;
        public X(int x) {
            this.x = x;
        private class Y implements Operation {
            public int op(int y) {
                return x+y;
        public Operation createOperation() {
            return new Y();
        public static void main(String[] args) {
            X app = new X(17);
            Operation f = app.createOperation();
            System.out.println(f.op(-11));
    }Your code, however, has some serious "issues". You typically don't
    instantiate an applet class -- that's the job of the applet viewer or Java plugin
    your browser is using. If you instantiate the applet directly, you're going
    to have to supply it an AppletStub. Do you really want to go that way?
    Again, use an applet viewer or browser, or better yet, why write applets at all?

  • How to use the COMM API in a JAR file

    I have developed an application, using the NetBeans IDE, to communicate with a modem over the COM1 serial port using the Java Comm API. The application works fine within the IDE, but when a JAR file is created and "double-clicked", the application launches correctly, but when the code is executed to "talk" over the COM1 serial port - nothing happens. No exceptions and no warnings are thrown. My environment is XP, SP1.
    The manifest file is as follows:
    Manifest-Version: 1.0
    Class-Path: ../j2sdk1.4.2/jre/lib/ext/TimerBean.jar ../j2sdk1.4.2/jre/
    lib/ext/AbsoluteLayout.jar ../j2sdk1.4.2/jre/lib/ext/comm.jar
    Created-By: NetBeans IDE
    Specified-By: Projects/TheApp/Files/TheApp.jarContent
    Main-Class: Main
    According to the Comm API installation instructions, the following files are copied:
    copy comm.jar \j2sdk1.4.2\jre\lib\ext
    copy wind32com.dll \j2sdk1.4.2\bin
    copy javax.comm.properties \j2sdk1.4.2\jre\lib
    I suspect it has something to do with the paths.
    Any help would be greatly appreciated. Thanks.

    Thanks for your input, but after trying what you suggested the problem still exists. I think your right to be suspicous of the javax.comm.properties file. The application, that worked in the IDE, exhibits the same behavoir as the JAR file if the javax.comm.properties file is removed from the ../jre/lib directory. In other words it compiles correctly in the IDE, but when executed, nothing happens when the code that "talks" to the serial port is run.
    I've tried moving the javax.comm.properties file into the working directory. Also, the CLASSPATH and PATH system variables were modified to include the path to javax.comm.properties.
    If you have anymore ideas, please let me know.
    Thanks.

  • Don't know how to make my main class import a jar file

    OK, the title doesn't make much sense but here are my create-jar.bat and manifest files:
    create-jar.bat:
    jar cvmf manifest.txt dassimul-admin.jar player/ admin/ com/ connector/ common/ *.class
    manifest.txt:
    Main-Class: admin.DASAdmin
    the problem is that in connector/ folder there is the jdbc mysql connector driver (.jar file).
    in Eclipse I can add this jar to the Java Build Path, so the program runs.
    When I double-click the dassimul-admin.jar file, I get a Class Not Found Exception
    C:\MYWORK\dassimul>java -jar dassimul-admin.jar
    FATAL ERROR WHILE LOADING SQL DRIVER: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    I think that the problem lies in the fact that admin.DASAdmin can't see and import the jar file in connector/ folder... am I right?

    It looks like you are putting the mysql jar file inside the dassimul jar. That won't work unless you write custom code. You should use the Class-Path attribute of the manifest to define a relative path(s) to the other jar(s) that you need to use.
    [http://java.sun.com/docs/books/tutorial/deployment/jar/index.html]

  • How to Invoke a main class in a jar file from my project

    Hi
    I am a new user of the Sun Java Studio enterprise. I would like to know how i can invoke a main method in a jar file associated to the project.
    regards
    Nisanth

    Could you please clarify: do you want to run your project or a project from an independent jar?
    In the first case just select Run Project from the project context menu or select a class with main method and click Run File in the class context menu.
    Regarding the second case:
    - I don't think there is such a feature in the IDE (running third party jars is not an IDE function). Could you explain why you need this?

  • How to make the browser reload an updated jar-file?

    Hi there,
    Previosly when running applets using MSIE, all needed to reload an updated jar-file was pressing CTRL+F5
    Currently I've been assigned to re-develop some of my old applets and now I realize that the old CTRL+F5 won't do the trick any more since the old jar file is still in the cache and the new jar file is not loaded.
    I learned the hard way that all I can do is to manually clear the cache of the browser (Tools | Options | Delete files) and restart the browser and after that the new jar file is correctly loaded.
    Cache settings of the browser is set to "Reload on every visit to the page"
    Currently running Win2k, MSIE 6.0 SP1 and MSJVM 3809 but the problem also exists on Win2k, MSIE 6.0 and MSJVM 3186.
    Isn't there any easier way to do this?
    Currently I don't even mind not caching the jar-files at all as long as I don't get my development work trashed by having to restart the browser after every new build...
    Why has the old CTRL+F5 behaviour been changed?
    BR
    /Jonas

    I have been closing IE and reopening it for 7 months now. I don't of any other way to reload an applet.
    Jason

  • How to tell if a class within a jar file is being accessed?

    Hello,
    I have written a web app using NetBeans 5.5 and some external libraries.
    Rome 0.9 and a Rome module georss-rome.jar.
    Everything works fine with the integrated Netbeans tomcat 5.5...
    When I try to deploy this as a war using Tomcat 5.5 standalone It will not work properly. To make things worse, I get no error.
    In my code, I instantiate a class in the georss module by doing the following:
                    GeoRSSModule geoRssModule = GeoRSSUtils.getGeoRSS(entry);
                    if(geoRssModule != null)
    ...do something;
    }I then check for null and if not null I do stuff with methods within that jar.
    Basically I pass a rss feed or a georss feed. If its a georss feed then geoRssModule would not be null.
    As I said, this works fine within integrated tomcat but does nothing (no expected action) with standalone which leads me to believe that this is a deployment/jar/classpath issue.
    To me it seems that the class GeoRSSModule is never actually instantiated, but I never get any errors or expected output.
    I set tomcat logging.properties to FINEST for all types of logging.
    Is there a way to determine if the jar is even being accessed for that class file?
    TIA!
    BTW, I dont have the module source.
    I also verified that the jars (rome.jar and georss-rome.jar) are being deployed to webapps/myapp/WEB-INF/lib
    Message was edited by:
    gforty

    GeoRSSModule geoRssModule = GeoRSSUtils.getGeoRSS(entry);Try placing logging statements before and after this statement so that you can track execution. Make sure that your code at least gets to this particular line where you instantiate the GeoRSSModule object. Then place a logging statement afterwards to see if an object was indeed created.
    What helps me in situations like this is that I also use the NetBeans attached debugger listening on your standalone Tomcat installation. This allows you to trace your execution on the server side, one line at a time, giving you a clearer understanding of program flow.

  • How to refer the unlimited key length JCE jar files.

    Hi All,
    The JDK 1.4.2_10 contains the local_policy.jar and US_export_policy.jar that do not permit an unlimited Key length( 64 bit).
    - So I downloaded the unlimited ( Java(TM) Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 1.4.2
    ) https://jsecom15d.sun.com/ECom/EComActionServlet;jsessionid=0F59ACFF95A61F6C0E78B5CE8E0FA93B.
    -Now I want JDK to refer these files without changing anything in existing JDK ( Means I don't want to replcae the existing local_policy.jar , US_export_policy.jar ).
    - Is there any option or property which can tell the JDK to refer the other
    files instead of this location :- C:\bea\WLS8.1SP04\jdk142_05\jre\lib\security.
    Means I want to override these 2 existing files local_policy.jar , US_export_policy.jar without replcaing them.
    Any pointers will be highly appreciated.

    A year later, this is still an issue. No replies ( btw, this is my new login name for the forums ).
    Thank You.

  • Accessing the inner class written inside the method

    Hi all,
    Can any of you tell me how to access the inner class's method which is written inisde the outer class's method. THe code fragment is
    class Outer
    private static final int ID = 3;
    public String name;
    public void methodA( int nn )
    final int serialN = 11;
    class inner
    void showResult()
    System.out.println( "Rslt= "+ID );
    } // end class inner
    // new inner().showResult();
    } // end methodA
    class Sample
    public static void main(String a[])
    //access the showResult of Inner class??
    Thanks in advance.
    aah

    class Outer {
      private static final int ID = 3;
      public String name;
      public void methodA( int nn ) {
        final int serialN = 11;
        class inner {
          void showResult() {
            System.out.println( "Rslt= "+ID );
        } // end class inner
        new inner().showResult();
      } // end methodA
    class Sample {
      public static void main(String a[]) {
        new Outer().methodA(5);
    }

  • How to access the int variable in the inner class

    hi all,
    i can't access the int variable in the inner class. can any one help me
    int count = 0;
    MouseMoveListener mouseMove = new MouseMoveListener() {
         public void mouseMove(MouseEvent e) {
              count1++;
              System.out.println(count);
    };how to access count variable
    thanks

    for this how can i access the countIf the count variable is a local variable you can't access it from within the
    inner class. Make it a member variable of the outer class instead:public class Outer {
       private int count;
       MouseMoveListener mouseMove= new MouseMoveListener() {
          public void mouseMove(MouseEvent me) {
             count++;
             System.out.println(count);
    }Alternatively, if you don't need that count variable anywhere else, you
    could simply make it a member variable of the inner class itself:public class Outer {
       MouseMoveListener mouseMove= new MouseMoveListener() {
          private int count;
          public void mouseMove(MouseEvent me) {
             count++;
             System.out.println(count);
    }kind regards,
    Jos

  • Can I use the inner class of one containing class by the other class

    Can I use the inner class of one containing class by the other class in the same package as the containing class
    eg I have a class BST which has inner class Enumerator. Can I use the inner class from the other class in the same pacckage as BST?

    Inner classes do not share the namespace of the package of the containing class. Also they are never visible to other classes in the same package.Believe what you want, then, if you're going to make up your own rules about how Java works. For people interested in how Java actually works, here is an example that shows why that assertion is false:
    package com.yawmark.jdc;
    public class Outer {
         public class Inner {
    }And...
    package com.yawmark.demo;
    import com.yawmark.jdc.*;
    public class Demo {
         public static void main(String[] args) {
              assert new Outer().new Inner() != null;
    }~

  • How to use the different class for each screen as well as function.

    Hi Experts,
    How to use the different class for each screen as well as function.
    With BestRegards,
    M.Thippa Reddy.

    Hi ThippaReddy,
    see this sample code
    Public Class ClsMenInBlack
    #Region "Declarations"
        'Class objects
        'UI and Di objects
        Dim objForm As SAPbouiCOM.Form
        'Variables
        Dim strQuery As String
    #End Region
    #Region "Methods"
        Private Function GeRate() As Double
                Return Double
        End Function
    #End Region
    Public Sub SBO_Appln_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean)
            If pVal.BeforeAction = True Then
                If pVal.MenuUID = "ENV_Menu_MIB" Then
                End If
            Else ' Before Action False
                End If
        End Sub
    #End Region
    End Class
    End Class
    Rgds
    Micheal
    Vasu Anna Regional Feeling a???? Just Kidding
    Edited by: micheal willis on Jul 27, 2009 5:49 PM
    Edited by: micheal willis on Jul 27, 2009 5:50 PM

  • How to use the implementation class in propetty pallete

    Hi,
    I am using forms 10g....I have to insert horizontal scroll bar in text item..
    I have only class files instead of jar files ...how cani place the class file instead of jar file...
    How to use the implementation class in property palette to display the PJC
    Thanks,
    Ansaf.

    The Implementation Class must reflect the full name of the class. For instance, if the full class name is : xx.yyy.zz.class_name, then put this in the Implementation Class property of the corresponding item.
    Also, the class must be stored in the equivalent directory structure, so that, in my example: <DEV_HOME>/forms/java/xx/yyy/zz
    Francois

  • How to get the object class field value in CDHDR table for vendor

    hi
    how to get the object class field value in CDHDR table for vendor

    Try KRED/KRED_N as object class in CDHDR for Vendor.

Maybe you are looking for

  • Error While trying to Convert a Date Value to string in POI API (Excel)

    Hi How can I convet a date value in excel to string value ? I am using POI API for excel sheet reading in JSP .

  • How to include a static file.... Please help..

    Hi guys.. i am going crazy here, so please help.... is it possible to use <jsp:include page="headlines.html" flush="true"/> to serve a static file( headlines.html) which is in say tomcat_home\bin.. also, i wonder why the following code creates a head

  • Data extraction from different clients

    Hi , I am extracting the  from R/3 810 to BI 800 client .  Is it possible to do the extraction from diffenrent clients  ? While extracting the data at infosource level  transfer rules structure is pointing to flatfile source system instead of sap sou

  • Working in Windows7, Photoshop Elements 12 doesn't close correctly

    Hi! My problems appears when i try to open Photoshop Elements 12 double-clicking de icon on the desktop. First time it's ok, but if I close the program's window, and then try to open again the program I can´t do it... It seems to start to open but th

  • Mac Help viewer is blank

    I've been using Tiger on this G4 for several months. Today, I clicked on Help menu in the Finder window. The viewer came up, but it was blank. At the same time, something happened to my Airport, but I got connected through Diagnostics. How can I get