Deprecating a package in JDK1.4

Hi folks,
We are developing a swing based software and its undergoing an major version upgrade. I would like to depricate few packages in the new version. How should I do it in JDK 1.4?
In 1.5, we could use @deprecate anotation, how do we do it in 1.4?
Please let me know about this.
Thanks,
Jade

Jadaaih wrote:
We are developing a swing based software and its undergoing an major version upgrade. I would like to depricate few packages in the new version. How should I do it in JDK 1.4?You mark it as deprecated in the javadocs. See java.lang.Thread for an example of this.

Similar Messages

  • Is it possible to get the source code of sun package in JDK1.4?

    If i want to review the code of the HTTP protocol handler and some other things.
    how can i get the source. or is it possible?
    thank you.

    See this post if you can figure out something out of it ....
    http://forum.java.sun.com/thread.jsp?forum=31&thread=391451

  • Help! How to get the Java Communication Package work in JDK1.3.1?

    I downloaded a Java Communications API Win32 ver 2.0 from java.sun.com, and try to use it to do some programming to communication ports with JDK1.3.1.
    I failed. When I tested with the samples (BlackBox, SimpleRead) coming with the javax.comm. It showed "no serial port found", something like that. I check the installation Instructions of the comm. package, it only described the installation under JDK1.1 and the pre-release version of JDK1.2. (and the installation of the same package in JDK1.1 and JDK1.2 are totally different.)I tried the specification with my JDK1.3, but it doesn't work.
    Who knows how to install the Javax.comm package in JDK1.3.1? Please let me know as soon as possible. Thanks a lot.

    This comes straight out of the FAQ that you got with your download:
    Q: My application does not find any ports when it enumerates available ports.
    Q: BlackBox gives me a message that says "No serial ports found!"
    A: In order for the Java communications API to find ports the file
    javax.comm.properties must be in the correct place. The preferred location
    is in <jdk>/lib. See the installation instructions for alternate locations
    and further information.
    Installation is very simple. Comm is a standard extension, so copy comm.jar to %JAVA_HOME%\jre\lib\ext
    This is all in the docs....

  • Jdk1.7_u7 not packaging on OSX

    All when packaging using JDK1.7U07 we see this error
    Create jar file celertech-orderrouting-jfx-client-0.19.0-SNAPSHOT.jar Dir build/classes/main
    [ant:deploy] java.io.IOException: Exec failed with code 1 command [[osascript, /var/folders/4x/zjcgnrwd08j5pd073sdc0k5c0000gp/T/build4975411250886784237.fxbundler/macosx/CelerTrader-dmg-setup.scpt] in unspecified directory
    [ant:deploy]      at com.sun.javafx.tools.packager.bundlers.IOUtils.exec(IOUtils.java:131)
    [ant:deploy]      at com.sun.javafx.tools.packager.bundlers.IOUtils.exec(IOUtils.java:107)
    [ant:deploy]      at com.sun.javafx.tools.packager.bundlers.IOUtils.exec(IOUtils.java:101)
    [ant:deploy]      at com.sun.javafx.tools.packager.bundlers.MacDMGBundler.buildDMG(MacDMGBundler.java:356)
    [ant:deploy]      at com.sun.javafx.tools.packager.bundlers.MacDMGBundler.bundle(MacDMGBundler.java:80)
    [ant:deploy]      at com.sun.javafx.tools.packager.PackagerLib.generateNativeBundles(PackagerLib.java:522)
    [ant:deploy]      at com.sun.javafx.tools.packager.PackagerLib.generateDeploymentPackages(PackagerLib.java:505)
    [ant:deploy]      at com.sun.javafx.tools.ant.DeployFXTask.execute(DeployFXTask.java:215)

    HI Igor
    Thanks for the help. We have switched from ant to gradle so the build output does not look the same. But you can see the information. I can't see anything that we have changed since it was working. The only thing that has changed is the drop in version to u07 because we thought that this was the stable release of JavaFX.
    Sorry had to truncate the log. Don't want to raise a JIRA for not reason but happy to [put all of this in.
    [code]
    19:19:39.485 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Class com.sun.javafx.tools.packager.bundlers.LinuxDebBundler loaded from ant loader (parentFirst)
    19:19:39.487 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Looking for bundlers for type=ALL format=any
    19:19:39.487 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Skip [Windows Application Bundler] as not supporting current platform
    19:19:39.487 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Class java.util.jar.JarFile loaded from parent loader (parentFirst)
    19:19:39.489 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Skip [MSI Bundler (WiX based)] as not supporting current platform
    19:19:39.489 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Skip [Exe Bundler (based on Inno Setup)] as not supporting current platform
    19:19:39.489 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Skip [Linux Application Bundler] as not supporting current platform
    19:19:39.490 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Skip [RPM bundler] as not supporting current platform
    19:19:39.490 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Skip [DEB bundler] as not supporting current platform
    19:19:39.490 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Preparing Info.plist: /var/folders/4x/zjcgnrwd08j5pd073sdc0k5c0000gp/T/build1423428664719564176.fxbundler/macosx/Info.plist
    19:19:39.491 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Couldn't load Resource package/macosx/Info.plist
    19:19:39.491 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Resource com/sun/javafx/tools/resource/mac/Info.plist.template loaded from ant loader
    19:19:39.491 [INFO] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Using default package resource [Bundle config file] (add package/macosx/Info.plist to the class path to customize)
    19:19:39.491 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Class java.net.URL loaded from parent loader (parentFirst)
    19:19:39.492 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Class java.util.Map$Entry loaded from parent loader (parentFirst)
    19:19:39.493 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Resource package/macosx/CelerTrader.icns loaded from ant loader
    19:19:39.494 [INFO] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Using custom package resource [icon] (loaded from package/macosx/CelerTrader.icns on class path)
    19:19:39.496 [INFO] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Creating app bundle: /Users/bencuthbert/dev/code/celertech-framework-trunk/celertech-orderrouting-jfx-client/build/tmp/jfx_package/bundles/CelerTrader.app
    19:19:39.497 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Resource com/sun/javafx/tools/resource/mac/JavaAppLauncher loaded from ant loader
    19:19:39.499 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Class java.nio.channels.FileChannel loaded from parent loader (parentFirst)
    19:19:42.958 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Class java.util.Arrays loaded from parent loader (parentFirst)
    19:19:42.958 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Running [ln, -s, ../Home/jre/lib/jli/libjli.dylib, .] in /Users/bencuthbert/dev/code/celertech-framework-trunk/celertech-orderrouting-jfx-client/build/tmp/jfx_package/bundles/CelerTrader.app/Contents/PlugIns/jdk1.7.0_07.jdk/Contents/MacOS
    19:19:42.977 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Class java.lang.Process loaded from parent loader (parentFirst)
    19:19:42.978 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Class java.io.BufferedReader loaded from parent loader (parentFirst)
    19:19:43.042 [INFO] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Config files are saved to /var/folders/4x/zjcgnrwd08j5pd073sdc0k5c0000gp/T/build1423428664719564176.fxbundler/macosx. Use them to customize package.
    19:19:43.042 [INFO] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Building DMG package for CelerTrader
    19:19:43.043 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Preparing Info.plist: /var/folders/4x/zjcgnrwd08j5pd073sdc0k5c0000gp/T/build1423428664719564176.fxbundler/macosx/Info.plist
    19:19:43.043 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Couldn't load Resource package/macosx/Info.plist
    19:19:43.043 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Resource com/sun/javafx/tools/resource/mac/Info.plist.template loaded from ant loader
    19:19:43.044 [INFO] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Using default package resource [Bundle config file] (add package/macosx/Info.plist to the class path to customize)
    19:19:43.045 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Resource package/macosx/CelerTrader.icns loaded from ant loader
    19:19:43.045 [INFO] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Using custom package resource [icon] (loaded from package/macosx/CelerTrader.icns on class path)
    19:19:43.047 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Resource com/sun/javafx/tools/resource/mac/JavaAppLauncher loaded from ant loader
    19:19:44.990 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Running [ln, -s, ../Home/jre/lib/jli/libjli.dylib, .] in /var/folders/4x/zjcgnrwd08j5pd073sdc0k5c0000gp/T/build1423428664719564176.fxbundler/images/dmg.image/CelerTrader.app/Contents/PlugIns/jdk1.7.0_07.jdk/Contents/MacOS
    19:19:45.076 [INFO] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Config files are saved to /var/folders/4x/zjcgnrwd08j5pd073sdc0k5c0000gp/T/build1423428664719564176.fxbundler/macosx. Use them to customize package.
    19:19:45.076 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Resource package/macosx/CelerTrader-background.png loaded from ant loader
    19:19:45.076 [INFO] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Using custom package resource [dmg background] (loaded from package/macosx/CelerTrader-background.png on class path)
    19:19:45.077 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Resource package/macosx/CelerTrader-volume.icns loaded from ant loader
    19:19:45.077 [INFO] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Using custom package resource [volume icon] (loaded from package/macosx/CelerTrader-volume.icns on class path)
    19:19:45.078 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Couldn't load Resource package/macosx/CelerTrader-post-image.sh
    19:19:45.078 [INFO] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Using default package resource [script to run after application image is populated] (add package/macosx/CelerTrader-post-image.sh to the class path to customize)
    19:19:45.078 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Preparing dmg setup: /var/folders/4x/zjcgnrwd08j5pd073sdc0k5c0000gp/T/build1423428664719564176.fxbundler/macosx/CelerTrader-dmg-setup.scpt
    19:19:45.079 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Couldn't load Resource package/macosx/CelerTrader-dmg-setup.scpt
    19:19:45.079 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Resource com/sun/javafx/tools/resource/mac/DMGsetup.scpt loaded from ant loader
    19:19:45.079 [INFO] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Using default package resource [DMG setup script] (add package/macosx/CelerTrader-dmg-setup.scpt to the class path to customize)
    19:19:45.080 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Creating DMG file: /Users/bencuthbert/dev/code/celertech-framework-trunk/celertech-orderrouting-jfx-client/build/tmp/jfx_package/bundles/CelerTrader.dmg
    19:19:45.080 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Running [usr/bin/hdiutil, create, -quiet, -srcfolder, /var/folders/4x/zjcgnrwd08j5pd073sdc0k5c0000gp/T/build1423428664719564176.fxbundler/images/dmg.image, -volname, CelerTrader, -ov, /var/folders/4x/zjcgnrwd08j5pd073sdc0k5c0000gp/T/build1423428664719564176.fxbundler/images/CelerTrader-tmp.dmg, -format, UDRW]
    19:19:55.114 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Running [usr/bin/hdiutil, attach, /var/folders/4x/zjcgnrwd08j5pd073sdc0k5c0000gp/T/build1423428664719564176.fxbundler/images/CelerTrader-tmp.dmg, -quiet, -mountroot, /var/folders/4x/zjcgnrwd08j5pd073sdc0k5c0000gp/T/build1423428664719564176.fxbundler/images]
    19:19:56.371 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Running [osascript, /var/folders/4x/zjcgnrwd08j5pd073sdc0k5c0000gp/T/build1423428664719564176.fxbundler/macosx/CelerTrader-dmg-setup.scpt]
    19:21:57.174 [INFO] [org.gradle.api.internal.project.ant.AntLoggingAdapter] /var/folders/4x/zjcgnrwd08j5pd073sdc0k5c0000gp/T/build1423428664719564176.fxbundler/macosx/CelerTrader-dmg-setup.scpt:815:854: execution error: Finder got an error: AppleEvent timed out. (-1712)
    19:21:57.175 [WARN] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [ant:deploy] java.io.IOException: Exec failed with code 1 command [[osascript, /var/folders/4x/zjcgnrwd08j5pd073sdc0k5c0000gp/T/build1423428664719564176.fxbundler/macosx/CelerTrader-dmg-setup.scpt] in unspecified directory
    19:21:57.192 [INFO] [org.gradle.api.internal.project.ant.AntLoggingAdapter] [DEBUG] Intermediate application bundle image: /var/folders/4x/zjcgnrwd08j5pd073sdc0k5c0000gp/T/build1423428664719564176.fxbundler/images/dmg.image
    19:21:57.193 [INFO] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Config files are saved to /var/folders/4x/zjcgnrwd08j5pd073sdc0k5c0000gp/T/build1423428664719564176.fxbundler/macosx. Use them to customize package.

  • JDK1.4.....where is javax.servlet*

    Does anyone know where the javax.servlet,javax.servlet.http packages are in JDK1.4?

    You need the JSDK which has the servlet.jar library. These don't come packaged with JDK1.4 as far as I know. Typically you need to donload them seperately. You'll then have to add the servlet.jar to your classpath.
    The servlet.jar can go anywhere, so long as it's in your classpath and javac and java can find it you should be okay.

  • Asking help for performance issues about concurrent package

    One of my friends is developing a service based on resin. They use thread pool of current package in jdk1.5. The service will create a lot of threads in the thread pool. And most of the threads are waiting. What they can not make sure is how the large amount of waiting threads will affect the performance. These threads surely will occupy a lot of memory. But how will they affect the cpu?
    Some documents on the Internet say that the large amount of waiting threads will largely increase the thread switching overhead. And some others say no because the scheduler will not be affected by waiting threads. I'm not sure which one is true. Would anyone like to give me some tips? It's better if you can point out any our documents about it.
    Thanks!

    No, it just depends on Data Structures 101.
    You would have a list of ready threads, from which you would allocate one to the processor on some priority and fairness scheme, and another list of non-ready threads which you would only promote to the ready list when something happened to them that made them ready.
    And among the ready threads you would most likely use a priority queue, so that operations on it were O(log(N)). And if the ready list also included the unready list for some strange reason, operations on it would still be O(log(N)), i.e. less than linear in the total number of threads.
    And if for some strange reason it was implemented in a less efficient way than that, I would complain vociferously to the vendor. Scheduling has been going on for fifty years after all.

  • Which package should I import for CachedRowSet?

    Hi,
    I am doing an example for the servlet. But, it needs to import sun.jdbc.rowset.CachedRowSet. I am using JBuilder6 and it did not find that package for jdk1.3.
    So, where should I get it?
    Thanks
    gogo

    JDBC 2.0 Optional Package API should be in the classpath.

  • Installation problem on fedora linux

    Hi
    I am trying to install oracle 10g to Fedora Linux.
    When I type ./runInstaller :
    Exception java.lang.UnsatisfiedLinkError: /tmp/OraInstall2007-08-21_12-40-12AM/jre/1.4.2/lib/i386/libawt.so:...........................
    Exception in thread main java.lang.NoClassDefFoundError
    Please help me to solve this problem

    Ricardinho,
    try post full error message (or stack trace) because in this case we can only guess...
    Also when you post name of Linux distribution then don't forget post the version.
    Anyway according to partial error message I think there is missing libXp.so.6 library on your OS.
    So execute "yum install libXp" to install required package. Od locate the package on installtion media and install it via "rpm -ivh" command.
    Note: In FC5 and later libXp.so.6 is included in libXp package. In FC4 and older releases you need to install xorg-deprecated-libs package.

  • Problem : Application run out of memory while processing image I/O.

    Hi,
    I have coded an application (utility) for creating scaled (JPEG) images (thumb nails) and writing (saving) them to files. I tried this with both imageio package of jdk1.4 and com.sun.image.codec.jpeg.* classes of earlier version. Application works with both versions but when I execute it for more (say more than 10 images) images, system becomes very slow and application starts throwing a memory related (OutOfMemoryError) error. Is it that objects of java image related classes consume too much memory ? How to solve this problem ? (My system run P4 processor with 256 MB RAM).
    Awaiting solution,
    Thanx and regards,
    IB

    So I am not alone in this...
    I wrote the jpeg thumbnail generating code over a year ago and now when I am ready to use it in the finished app. I noticed that each process (as monitored using Forte 3's execution window) that instantiates a new ImageIcon object is never killed by the JVM. As more and more processes are started for distinct tasks they build up endlessly. Here's the method which is almost identical to the test code provided in sun's tutorial for generating thumbnails from jpeg and gif image files (http://developer.java.sun.com/developer/TechTips/1999/tt1021.html) :
    public boolean createThumbImage(int maxDim) throws EntegraEntityException {
         * Reads an image in a file and creates
         * a thumbnail in another file.
         * @param this.getImagePath() The name of image file.
         * @param thumb The name of thumbnail file. 
         * Will be created if necessary.
         * @param maxDim The width and height of
         * the thumbnail must
         * be maxDim pixels or less.
           String thumbsource =  this.path + this.filename;
           String thumbdest = this.path + "thumbs_" + maxDim + File.separator/*"\\"*/ + Utilities.replaceString(Utilities.replaceString(this.filename," ","_","ALL").trim(),"[.][a-zA-Z]*",".jpg","ALL");
       //  System.out.println("thumbsource in createthumbimage(): " + thumbsource + "\n");
       //  System.out.println("thumbdest in createthumbimage(): " + thumbdest + "\n");
            try {
                // Get the image from a file.
                java.awt.Image inImage = new ImageIcon (thumbsource).getImage();
                // Determine the scale.
             double scale = (double)maxDim/(double)inImage.getHeight(null);
                if (inImage.getWidth(null) > inImage.getHeight(null)) {
                    scale = (double)maxDim/(double)inImage.getWidth(null);
                // Determine size of new image.
                //One of them
                // should equal maxDim.
                int scaledW = (int)(scale*inImage.getWidth(null));
                int scaledH = (int)(scale*inImage.getHeight(null));
                // Create an image buffer in
                //which to paint on.
                BufferedImage outImage =
                  new BufferedImage(scaledW, scaledH,
                    BufferedImage.TYPE_INT_RGB);
                // Set the scale.
                AffineTransform tx =
                  new AffineTransform();
                // If the image is smaller than
                //the desired image size,
                // don't bother scaling.
                if (scale < 1.0d) {
                    tx.scale(scale, scale);
                // Paint image.
                Graphics2D g2d =
                 outImage.createGraphics();
                g2d.drawImage(inImage, tx, null);
                g2d.dispose();
                // JPEG-encode the image
                //and write to file.
                Utilities.fileMakeDirs(this.path + "thumbs_" + maxDim + File.separator/*"\\"*/);
                Utilities.fileMakeFile(thumbdest);
                OutputStream os =
                 new FileOutputStream(thumbdest);
                JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(os);
                encoder.encode(outImage);
                os.close();
                return true;
            } catch (IOException e) {
                throw new EntegraEntityException("IO exception creating thumbnail for Image object ID: " + this.getId() + " ::",e);
            } catch (EntegraFileIOException fi) {
                throw new EntegraEntityException("File IO exception creating thumbnail for Image object ID: " + this.getId() + " ::",fi);
        //    return false; //Never reached. Since it doesn't live in the "try" block but must be here to ensure method body gets a return value.
    }:During my troubleshooting of the method execution yesterday I discovered that the stuck process only occurs as a consequence of the line shown in bold below :
    java.awt.Image inImage = new ImageIcon (thumbsource).getImage();
    :this indicates to me that there is something wrong with how either the Image object or the ImageIcon file resources are allocated. At first I tried using the "flush()" method of the java.awt.Image class to release the resources to no avail, later I was able to confirm that the error does not occur for the default constructor of ImageIcon only for the one that specifies the source path (as shown in the line above) this indicates that a fileIO stream is being created and probably not being released inside ImageIcon or Image, but since that stream is probably private to those core classes we can't access it to close() it properly. I sure hope I am wrong on this or there is an alternative to using these classes..
    Please let me know if any of you have other ideas on how to quash this bug or can otherwise find flaws in my logic for it's occurance.
    Regards,
    Sent2null

  • J2ME and java.nio

    I'm not sure which forum this should go in so applogies if I got it wrong.
    I would like to use the java.nio package from JDK1.4 with the J2ME. Is this possible in any way?
    cheers
    Andrew

    I'm not sure which forum this should go in so
    applogies if I got it wrong.
    I would like to use the java.nio package from JDK1.4
    with the J2ME. Is this possible in any way?this topic should be post at
    CLDC and MIDP
    http://forum.java.sun.com/forum.jsp?forum=76
    or
    K Virtual Machine (KVM)
    http://forum.java.sun.com/forum.jsp?forum=50
    CLDC 1.0 and MIDP 1.0 doesn't include java.nio
    please go to
    http://java.sun.com/j2me/docs/
    two documents will be useful
    CLDC Specification, V1.0
    MIDP 1.0 Specification, Final (JSR 37)

  • Having problem importing a class

    When I compile my program called Dic2.java, I get the following error:
    C:\Program Files\Java\jdk1.6.0_01\bin>javac Dic2.java
    Dic2.java:1: '.' expected
    import Entry;
    ^
    1 error
    I compiled my Entry class and it did just fine. Here is my code for Dic2.java:
    import Entry;
    public class Dic2
      protected Entry entries[];
      public Dic2(String puzzle)  // constructor
        if (puzzle == "unscramble")
          entries[0] = new Entry("stupid", "Insult");
          entries[1] = new Entry("monkey", "Zoo animal");
          entries[2] = new Entry("meerkat", "Animal Planet had a series set in the Kalahari Desert featuring this small furry animal");
          entries[3] = new Entry("burrow", "Where meerkats sleep and raise their pups");
          entries[4] = new Entry("boogers", "Gross things");
    }I don't know why my compiler wants a period. I hope you can help me. Your help will be greatly appreciated.

    I know you're gonna think I'm crazy, but I I've just started using jdk1.6.0_01 after years of using my more familiar jdk1.2.1. I'm used to compiling packages to jdk1.2.1/jre/classes/com/whatever. I have done similar programs using my own classes in my old version and didn't have to compile them to a package. Is this a newer requirement?
    Also, which path should I take to compile a class in the newer jdk1.6.0_01? It's all different from my old jdk1.2.1.

  • Oracle-9.2.0.4 Indtallation in RHEL4

    I am trying to Install oracle 9.2.0.4 on Linux RHEL4. I am getting the follwoing error. Can someone please help me to resolve this isses?
    [oracle@initst Disk1]$ ./runInstaller
    [oracle@initst Disk1]$ Initializing Java Virtual Machine from /tmp/OraInstall2007-08-24_12-46-10PM/jre/bin/java. Please wait...
    Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/OraInstall2007-08-24_12-46-10PM/jre/lib/i386/libawt.so: libXp.so.6: cannot open shared object file: No such file or directory
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1477)
    at java.lang.Runtime.loadLibrary0(Runtime.java:788)
    at java.lang.System.loadLibrary(System.java:834)
    at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.awt.NativeLibLoader.loadLibraries(NativeLibLoader.java:38)
    at sun.awt.DebugHelper.<clinit>(DebugHelper.java:29)
    at java.awt.Component.<clinit>(Component.java:506)
    at oracle.sysman.oii.oiic.OiicInstaller.main(OiicInstaller.java:593)

    Hi, you must ensure that xorg-x11-deprecated-libs package was installed.
    Also you can review the Note:443617.1 into metalink site.
    Regards.

  • Parsing Huge Fixed length files

    Hi All,
    I have a requirement to parse a fixed lenght file which is of size 100MB. I have 1.7 million records in that file where each and every record is of length 41. When I am trying to load the file using the LineNumberReader and using the substring it's throwing java.lang.OutMemoryError. I tried with the -Xmx1500M, it's the same. I am also using the reflection API to populate the java beans with the parsed values.
    I am thinking a way that I read a chunk of data from the file and parse it, read the next chunk parse it etc... Is there a way like this in java 1.5 or 1.6? I heared about the nio package in JDK1.5. I am looking at it If that can helpful to me.
    If any body have an idea or best practice how can we deal huge fixed lenght files in java, please suggest me.
    Thank you.

    krishna2581 wrote:
    I realised that I forgot to mention few points thats why reposted any problem with that?The problem is that if I see only one of your posts, and somebody else sees only the other one, we may end up wasting time duplicating each others' work in answering you. Either continue in your original thread--edit the first post if nobody has replied--or if you must start a new thread, provide a link to it from the original so that the discussion is all in one place.

  • Prasing a huge Fixed lenght file

    Hi All,
    I have a requirement to parse a fixed lenght file which is of size 100MB. I have 1.7 million records in that file where each and every record is of length 41. When I am trying to load the file using the LineNumberReader and using the substring it's throwing java.lang.OutMemoryError. I tried with the -Xmx1500M, it's the same.
    I am thinking a way that I read a chunk of data from the file and parse it, read the next chunk parse it etc... Is there a way like this in java 1.5 or 1.6? I heared about the nio package in JDK1.5. I am looking at it If that can helpful to me.
    If any body have an idea or best practice how can we deal huge fixed lenght files in java, please suggest me.
    Thank you.

    BigDaddyLoveHandles wrote:
    abillconsl wrote:
    BigDaddyLoveHandles wrote:
    abillconsl wrote:
    prase noe record at a tiemI need to get outside and breathe some fresh air. That sentence looked fine to me, at first.That's because you've been looking at generics and closures for too long.
    ... Sorry, I could not resist - I will stop now (starting to sound like an old hen, I am) ... you've been a good sport. ;-)Maybe it's time for me to learn Scala.Scala got my interest for a spell. Then I read a bit about it and it started to sound an awful lot like someone trying to draw all kinds of attention to themselves while trying to ride the "latest" popular programming trends wave.

  • Non-blocking socket concurrent limitation?

    I have 2 socket program,one is server side used nio package with JDK1.4.1,the other is client used traditional socket,the client will initialize about 50
    threads trying to connect with server when starting,but only about 15
    can be accepted,these 2 program are runnning in the same computer which
    OS is win2000 professional PC.
    the followd is these code:
    please make a probe with them ,and tell me what's going on?
    server:
    package nio_select_demo;
    import java.io.*;
    import java.net.*;
    import java.nio.*;
    import java.nio.channels.*;
    import java.util.*;
    import java.nio.charset.Charset;
    import java.nio.charset.CharsetDecoder;
    public class Server implements Runnable
    // The port we will listen on
    private int port;
    // A pre-allocated buffer for processing data
    private final ByteBuffer buffer = ByteBuffer.allocate( 16384 );
    private ByteBuffer resBuf = ByteBuffer.allocate( 128 );
    Selector selector;
    AddInfo test ;
    public Server( int port ) {
    this.port = port;
    // for (int i=0; i<threadnum; ++i) {
    new Thread( this ).start();
    test = new AddInfo();
    test.start();
    public void run() {
    try {
    // create a ServerSocketChannel
    ServerSocketChannel ssc1 = ServerSocketChannel.open();
    // ServerSocketChannel ssc2 = ServerSocketChannel.open();
    // Set it to non-blocking
    ssc1.configureBlocking( false );
    // Get the Socket connected to this channel, and bind it
    // to the listening port
    ServerSocket ss = ssc1.socket();
    InetSocketAddress isa = new InetSocketAddress( port );
    ss.bind( isa , 60 );
    // Create a new Selector for selecting
    selector = Selector.open();
    // Register the ServerSocketChannel, so we can
    // listen for incoming connections
    ssc1.register( selector, SelectionKey.OP_ACCEPT );
    System.out.println( "Listening on port "+port );
    int n = 0;
    while (true) {
    // See if we've had any activity -- either
    // an incoming connection, or incoming data on an
    // existing connection
    int num = selector.select();
    // If we don't have any activity, loop around and wait
    // again
    if (num == 0) {
    continue;
    // Get the keys corresponding to the activity
    // that has been detected, and process them
    // one by one
    Set keys = selector.selectedKeys();
    Iterator it = keys.iterator();
    while (it.hasNext()) {
    // Get a key representing one of bits of I/O
    // activity
    SelectionKey key = (SelectionKey)it.next();
    // What kind of activity is it?
    if ((key.readyOps() & SelectionKey.OP_ACCEPT) ==
    SelectionKey.OP_ACCEPT) {
    System.out.println( "accept request" );
    // It's an incoming connection.
    // Register this socket with the Selector
    // so we can listen for input on it
    SocketChannel sc = ((ServerSocketChannel)key.channel()).accept();
    System.out.println( "Got connection from "+sc.socket());
    // Make sure to make it non-blocking, so we can
    // use a selector on it.
    //SocketChannel sc = s.getChannel();
    sc.configureBlocking( false );
    // Register it with the selector, for reading
    sc.register( selector, SelectionKey.OP_READ| SelectionKey.OP_WRITE);
    } else if ((key.readyOps() & SelectionKey.OP_READ) ==
    SelectionKey.OP_READ) {
    //ssc.register(selector , SelectionKey.OP_READ);
    SocketChannel sc = null;
    try {
    // It's incoming data on a connection, so
    // process it
    sc = (SocketChannel)key.channel();
    Socket s1 = sc.socket();
    s1.setTcpNoDelay(true);
    System.out.println( "enter processing data" );
    boolean ok = processInput( key );
    synchronized (selector) {
    key.interestOps(key.interestOps() & ~SelectionKey.OP_READ);
    // If the connection is dead, then remove it
    // from the selector and close it
    if (!ok) {
    key.cancel();
    System.out.println("dead");
    Socket s = null;
    try {
    s = sc.socket();
    s.close();
    } catch( IOException ie ) {
    System.err.println( "Error closing socket "+s+": "+ie );
    } catch( IOException ie ) {
    ie.printStackTrace();
    // On exception, remove this channel from the selector
    key.cancel();
    System.err.println( "Error raised in this socket");
    try {
    sc.close();
    } catch( IOException ie2 ) { System.out.println( ie2 ); }
    System.out.println( "Closed "+sc );
    else if ((key.readyOps() & SelectionKey.OP_WRITE) ==
    SelectionKey.OP_WRITE) {
    System.out.println("Enter Writing");
    String response = new String();
    if((response=this.test.getInfo())!=null){
    resBuf.clear();
    SocketChannel sc = (SocketChannel)key.channel();
    resBuf = ByteBuffer.wrap( response.getBytes("ISO-8859-1" ) );
    sc.write( resBuf );
    synchronized (selector) {
    key.interestOps(key.interestOps() & ~SelectionKey.OP_WRITE);
    // We remove the selected keys, because we've dealt
    // with them.
    keys.clear();
    } catch( IOException ie ) {
    System.err.println( ie );
    private boolean processInput( SelectionKey key ) throws IOException {
    buffer.clear();
    SocketChannel sc = (SocketChannel)key.channel();
    sc.read( buffer );
    buffer.flip();
    String response = new String("response ok");
    // If no data, close the connection
    if (buffer.limit()==0) {
    return false;
    Charset charset=Charset.forName("ISO-8859-1");
    CharsetDecoder decoder = charset.newDecoder();
    CharBuffer charBuffer = decoder.decode(buffer);
    System.out.println(charBuffer.toString());
    System.out.println( "Processed "+buffer.limit()+" from "+sc );
    return true;
    static public void main( String args[] ) throws Exception {
    int port = Integer.parseInt( args[0] );
    System.out.println(port);
    new Server( port );
    cilent:
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public class Client implements Runnable
    private String host;
    private int port;
    private int acport;
    //the size of buffer on how much we write and read per cycle
    private static final int maxWriteSize = 128;
    public Client( String host, int port, int numThreads ) {
    this.host = host;
    this.port = port;
    for(int i =0;i<50;i++){//initialize 50 client threads
    new Thread(this).start();
    public void run() {
    byte buffer[] = new byte[maxWriteSize];
    byte buffer2[] = new byte[maxWriteSize];
    try {
    Socket s = new Socket( );
    InetSocketAddress sa = new InetSocketAddress(host,this.port);
    s.connect(sa);
    System.out.println(s);
    s.setTcpNoDelay(true);
    InputStream in = s.getInputStream();
    OutputStream out = s.getOutputStream();
    for (int i=0; i<maxWriteSize; ++i) {
    buffer[i] = (byte)'a';
    out.write( buffer, 0, maxWriteSize );
    int pause = 500;
    in.read( buffer , 0 , maxWriteSize );
    System.out.println( Thread.currentThread()+" wrote "+maxWriteSize);
    String res = new String ( buffer );
    String res2 = new String ( buffer2 );
    System.out.println( res );
    try { Thread.sleep( pause ); } catch( InterruptedException ie ) {}
    } catch( Exception ie ) {
    ie.printStackTrace();
    System.err.println(ie.getMessage());
    static public void main( String args[] ) throws Exception {
    String host = "127.0.0.1";
    int port = Integer.parseInt( args[0] );
    int numThreads = Integer.parseInt( args[1] );
    new Client( host, port, numThreads );

    I have found the reason!!!
    because of system resource limitation,windows can't afford to maintain
    so many concurrent stream-IO,so some socket will be closed.
    I modified the client side code,adding thes segments to client instantialize
    such as :
    public Client( String host, int port, int numThreads ) {
    for(int i =0;i<1000;i++){
    new Thread(this).start();
    try {
    Thread.currentThread().sleep(100);//give system some idle
    } catch (InterruptedException e) {
    /* ignore */
    then the server can accept more than 1000 client request concurrently.

Maybe you are looking for