Java on FreeBSD 5.1

hi all,
i'm kinda new to BSD and i'm tryin to install j2sdk-1.4.1_02. This has been the most frustrating installation i've ever had to do. i've not yet set up my network connection in BSD so i have to reboot to windows anytime i have to go online, and this is what's happening
first of all
cd /usr/ports/java/jdk14
makethe install starts then exits with error that's could not download bsd-jdk14-patches-3[1].tar.gz
'cos i'm not online in bsd i have to reboot to windows to download the file.
run make again back in BSD, this time the process goes a bit further then exits on error message again; this time needs the file j2sdk-1_4_1-src-scsl.zip, reboot back to windows, download the file.
Back to BSD run make again, goes further still then exits on error, needs to download the file zip23.tar.gz .... i've had to reboot ma system like ten times to download more files...
zcrypt29-exportable.zip
openmotif-2.2.2.tar.gz
j2sdk-1_4_1_02-linux-i586.bin and the list goes on n on.
I dont know if there's a list of files i have to download, if anyone knows of such a list can u post it on here so i download all the necessary files at one time rather than switch from windows to bsd again n again. Or if u have any useful info kindly let me know.
Thanks everyone

hey i fixed it i just went ahead n run j2sdk-1_4_1_02-linux-i586.bin
For anyone else who has this problem i'd say its much easier to install Sun's JDK than FreeBSD JDK so u might want to do that.

Similar Messages

  • Java Comm API in FreeBSD? HELP!!!

    I'm doing a project for my company that needs to access the serial port, with commAPI the thing works flawlessly under Windows XP, however big problem comes with commAPI doesn't work in FreeBSD which the company server runs on. This is what I have done so far :
    Downloaded the Linux version of comm3.0, and extracted the .so files into /usr/local/java/jre/lib/i386/ directory, the comm.jar into /usr/local/java/jre/lib/ext/ directory, and the javax.comm.properties into /usr/local/java/jre/lib/ directory. The test program compiled fine, but during running it says no port found.
    So I fumbled around and edited the javax.comm.properties file to make the serial port entry cuaa0, and now it finds the port fine, but when it tries to open the port, an error pops up like this
    Exception in thread "main" java.lang.RuntimeException:
    Error opening "/dev/cuaa0"
    lockf(): Invalid argument
    at com.sun.comm.LinuxDriver.getCommPort(LinuxDriver.java:66)
    at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:369)
    at nulltest.<init>(nulltest.java:133)
    at nulltest.main(nulltest.java:76)
    It seems the getCommPort method calls a lockf() function with an invalid argument? Now I'm at a loss of what to do, anyone has any idea how can this be fixed? Thanks!

    It appears there are a number of ports of comm
    packages to FreeBSD, see the referenced page. RXTX is
    one that works well in other environments.
    http://www.freebsdsoftware.org/comms/
    I tried java-commapi-freebsd, but it also reports an error when opening the port
    FreebsdSerial: UnsatisfiedLinkError = /usr/local/java/jre/lib/i386/libSerial.so: /usr/local/java/jre/lib/i386/libSerial.so: ELF file OS ABI invalid
    java.lang.UnsatisfiedLinkError: /usr/local/java/jre/lib/i386/libSerial.so: /usr/local/java/jre/lib/i386/libSerial.so: ELF file OS ABI invalid
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503)
    at java.lang.Runtime.loadLibrary0(Runtime.java:788)
    at java.lang.System.loadLibrary(System.java:834)
    at org.freebsd.io.comm.FreebsdSerial.<clinit>(FreebsdSerial.java:85)
    at org.freebsd.io.comm.FreebsdDriver.getCommPort(FreebsdDriver.java:114)
    at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634)
    at ATTest2.main(ATTest2.java:27)
    Exception in thread "main" java.lang.UnsatisfiedLinkError: deviceOpen
    at org.freebsd.io.comm.FreebsdSerial.deviceOpen(Native Method)
    at org.freebsd.io.comm.FreebsdSerial.<init>(FreebsdSerial.java:115)
    at org.freebsd.io.comm.FreebsdDriver.getCommPort(FreebsdDriver.java:114)
    at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634)
    at ATTest2.main(ATTest2.java:27)And then I tried RXTX, but it seems that tere's some problem to send the cartridge return character, so I can't send the AT commands properly to get any response. I tried \r \r\n \x0d etc. to no avail. Any idea what's the problem with the java-commapi-freebsd thing, or how to send the AT commands properly with RXTX? Thanks a lot!

  • Java on FREE BSD

    Hi!
    Can Java run on freebsd?
    I am planning to create a server running ung freebsd. I stumbled on a forum post that installing java on freebsd is kind of difficult (you need to compile)

    To be brutally honest, most Intel / AMD X86 / X86-64 machines will blow the processors off of a Sun Blade SPARC workstation. However, please don't let that discourage you as it can handle everything you have mentioned and much more. Also, if I were you, I would get the Sun Blade 2500 Silver edition with dual 1.6 ghz and no less that 4 gigs ram. This is the machine that I own and picked it up on ebay for about $600 and it's very nice. SUN workstations have a much higher quality building engineering, thus the hardware is top notch in that respect. Running Solaris 10 on this machine and you will have an EXTREMELY stable platform on which to work. I own one of these systems and run Solaris 10 and inside Solaris 10 I do Solaris 9 and Solaris 8 development / testing running each OS in its respective zone. Consider this the VM technology of SPARC Solaris. :) You're absolutely correct in that Solaris is a very powerful UNIX operating system and the integration between SPARC and Solaris is unmatched when comparing to the X86 world. The closest competitor is Apple, which are also very nice.
    In conclusion, I absolutely love my SPARC Sun Blade 2500 Silver and highly recommend any enthusiast to pick one up on ebay for cheap.
    Regards,
    JT

  • Serial Entry API in warehouse Mangement

    Hi
    Can any one plz help me. I have one requirement in receipt screen in warehouse management responsibility. Business requires a upload button in serial entry screen .when they upload the attachment through the upload button , then serials will automatically populate in serial entry screen.  is there any API's to populate the serials in serial entry screen automatically?
    Nav : Warehouse Operative Responsibility------------> Receipts screen ------------> Lot/Serial(Button)------------> Serials(Button)
    Regards|Surendra

    It appears there are a number of ports of comm
    packages to FreeBSD, see the referenced page. RXTX is
    one that works well in other environments.
    http://www.freebsdsoftware.org/comms/
    I tried java-commapi-freebsd, but it also reports an error when opening the port
    FreebsdSerial: UnsatisfiedLinkError = /usr/local/java/jre/lib/i386/libSerial.so: /usr/local/java/jre/lib/i386/libSerial.so: ELF file OS ABI invalid
    java.lang.UnsatisfiedLinkError: /usr/local/java/jre/lib/i386/libSerial.so: /usr/local/java/jre/lib/i386/libSerial.so: ELF file OS ABI invalid
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503)
    at java.lang.Runtime.loadLibrary0(Runtime.java:788)
    at java.lang.System.loadLibrary(System.java:834)
    at org.freebsd.io.comm.FreebsdSerial.<clinit>(FreebsdSerial.java:85)
    at org.freebsd.io.comm.FreebsdDriver.getCommPort(FreebsdDriver.java:114)
    at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634)
    at ATTest2.main(ATTest2.java:27)
    Exception in thread "main" java.lang.UnsatisfiedLinkError: deviceOpen
    at org.freebsd.io.comm.FreebsdSerial.deviceOpen(Native Method)
    at org.freebsd.io.comm.FreebsdSerial.<init>(FreebsdSerial.java:115)
    at org.freebsd.io.comm.FreebsdDriver.getCommPort(FreebsdDriver.java:114)
    at javax.comm.CommPortIdentifier.open(CommPortIdentifier.java:634)
    at ATTest2.main(ATTest2.java:27)And then I tried RXTX, but it seems that tere's some problem to send the cartridge return character, so I can't send the AT commands properly to get any response. I tried \r \r\n \x0d etc. to no avail. Any idea what's the problem with the java-commapi-freebsd thing, or how to send the AT commands properly with RXTX? Thanks a lot!

  • Freebsd Java path & classpath

    Hi everybody,
    I am new to the Freebsd env, and I am having trouble with compiling java code. Below is my system configurations. Note. I am able to compile and run the Hello World program., but when I import classes into my code I get "cannot resolve symbol".
    The path and classpath are setup in the .cshrc file as I am using the csh shell.
    %which java
    /usr/local/jdk1.4.2/bin/java
    %which javac
    /usr/local/jdk1.4.2/bin/javac
    %echo $CLASSPATH
    /usr/local/jdk1.4.2/lib/tools.jar:/usr/local/jdk1.4.2/lib/dt.jar:/usr/local/jdk1.4.2/jre/lib/rt.jar:
    %echo $PATH
    /sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/local/jdk1.4.2/bin:/usr/X11R6/bin:/home/george/bin
    set JAVA_HOME=/usr/local/jdk1.4.2
    If anyone has any suggestions they are welcome. Thanks

    I am pretty clueless on Freebsd but you might need to add .: to your Classpath or may be try to use the -classpath option in your command line:javac -classpath some_directory your_class.java

  • Java 1.5 on FreeBSD

    I've written some code that now needs to be run on FreeBSD.
    The code makes extensive use of generics (and other 1.5-only features), so it cannot be run on JRE1.4 as is. JRE1.5 for FreeBSD is in beta now and is not supported by Sun. I would like to avoid rewriting the code to run on JRE1.4, but on the other hand I don't feel very comfortable using a beta version of JRE in production system.
    Another option is to run the official JRE1.5 for Linux via a binary compatibility package, but I'm unsure if it's a viable solution.
    Does anyone have any experience working with Java 1.5 on FreeBSD?

    This is your lucky day.
    It was just announced.
    http://www.freebsdfoundation.org/downloads/java.shtml
    enjoy

  • Error while running Swing program on FreeBSD

    Hi,
    I am trying to run simple swing program "helloworld"
    but while executing it gives following error on FreeBSD
    Exception in thread "main" java.lang.UnsatisfiedLinkError:
    /usr/local/linux-sun-jdk1.4.2/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.EventQueue.<clinit>(EventQueue.java:80)
            at javax.swing.SwingUtilities.invokeLater(SwingUtilities.java:1170)
            at JPanels.main(JPanels.java:29)
    Should i install XFree86-libs package on FreeBsd
    configuration
    FreeBSD 4.10-BETA (GENERIC)
    I am using following packages
    linux-sun-jdk-1.4.2.04 Sun Java Development Kit 1.4 for Linux
    linux_base-8-8.0_4 Base set of packages needed in Linux mode (only for i386)
    linux_devtools-8.0_1 Packages needed for doing development in Linux mode
    libtool-1.3.5_1 Generic shared library support script
    gmake-3.80_1 GNU version of 'make' utility
    automake-1.4.5_9 GNU Standards-compliant Makefile generator (legacy version
    GCC 2.95.4
    gdb 4.18
    ld 2.12.1 supported emulation elf_i386
    regards
    Man479

    This is not really a Swing question. You should install the library which satisfies the lookup of libXp.so.6 .
    I quess the jre for this platform is compiled against this version. Looks to me like some X related library, maybe google can resolve a solution/package to install?
    Greetz

  • How to install new fonts using code in java?

    Hi,
    How to install font in a system using java, provided i know the font file's address. Is there any specific class/method available for this purpose? Copying the file to windows/font directory will work for windows, but I think it wont be generic to all operating system. So is there anyway to install a font using code?
    I also want to know how to make the font available only until my application window is open, It must be available to all other external applications like photoshop, word etc., When I close my window it must un-install automatically or be made not available to other applications. Any suggestions? Please do help! Thanks in advance...

    I have already tried the above, But the font created using input stream is available only to my application* and is not viewable in photoshop.*. I realize this. Like I said, I know of no method that will register/deregister the font with the system. You'll have to create your own method that takes the operating system into account.
    String os = System.getPropery("os.name");
    if(os.equals("Windows Vista")) {
    }else if(os.equals("Windows XP")) {
    }else if(os.equals("Windows NT")) {
    }else if(os.equals("Solaris")) {
    AIX
    Digital Unix
    FreeBSD
    HP UX
    Irix
    Linux
    Mac OS
    Mac OS X
    MPE/iX
    Netware 4.11
    OS/2
    Solaris
    Windows 2000
    Windows 95
    Windows 98
    Windows NT
    Windows Vista
    Windows XPYou'll need the standard font directory for each system. I think all the window ones are C:\Windows\Font\ . Each OS probably has its own little quark (like having several font directories or throwing different security exceptions). Undoubtly it's going to require some research and a bit of trial and error. You can probably work some magic with Runtime.exec(...) as well.
    The alternative would be to google for some libraries that offer similar functionality, or promt the user for the system's font directory and save the location of the directory in a file somewhere for future use (so the user dosen't have to specify the font directory everytime he/she starts up the application).

  • Java platform independent.what is a platform?

    This question has been haunting me for a long time.
    When we say Java is platform independent,what does the term platform
    indicate?
    I think it is Processor+Operating System.
    But people talk only of Operating System as platform.
    A processor has its own instruction set that is different from that of other processors.An executable code on one processor doesn't run on another processor,whatever may be the operating system.
    Java code is platform independent because it is just compiled to byte code and that byte code is interpreted and run on a JVM.Here the JVM is different for different platforms.
    My question is:
    consider two platforms:
    Intel Pentium+MS Windows.
    and AMD Athlon+MS Windows.
    Is the same JVM used for both these platforms?or not?WHY?
    If only Operating System is Considered as platform,what happens to the underlying processor?

    <troll style="flamesuit: on;">Java is not plateform inderpendent, java runs on one plateform, the Java Platform.</troll>
    The "Intel / AMD + MS Windows" is two forks of one plateform, the x86 / Windows plateform.
    You could extends the x86/Windows JVM to include Intel extras in such a way that it would not run on AMD/Windows.
    One way you could define a plateform is as a binary format, processor intuction set and public API.
    So java == .class format, bytecode and the java.* packages
    and Linux x86 == ELF, x86 and POSIX (plus others, such as X)
    and FreeBSD x86 == ELF, x86 and POSIX (plus others, such as X)
    and Cygwin == ELF, x86 and POSIX (plus others, such as X)
    and Windowsx86 == PE, x86, MFCs
    But does that mean Linux, FreeBSD and Cygwin are the same plateform, well kind-of, they are all unix-sqe, and in some cases the binarys are interchangable (a small plug in to FreeBSD will let you run Linux software, the same sort of thing is aviable to Solaris, and some very small (hello world-level) will actually run (I've seen this in the case of a Linux HelloWorld on a BeOS machine).

  • Email queue on java

    Hello, first of all I'm new to Java. We've a service written with PHP which sends a lot of emails to our users. Right now all new email messages added to MongoDB and by cron script(PHP) we send them out. I'm trying to implement a Mail Queue Daemon with Java, so it could process them asynchronous and without cron script. (We need to remove delays with cron, and if we will call php script faster, we will stuck in a concurrency with fetching, sending, removing emails from Mongo)
    The question is does Java community have any kind of class I can use or should I write it from scratch? I would appreciate any advices.
    Thanks.

    Well, sorry for not replying sooner. I wrote a little script, it works as I wanted to and everything good, except the size. I put it on github please take a look maybe i missed something or it can be tune. I tested it with hundreds of emails to be sent, and postfix log showed that for each email my daemon creates new connection. I didn't find how to use persistent connection with JavaMail, but i actually haven't searched it yet &) But what is more important is ps -aux on our freebsd:
    PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND
    68094 root 18 44 0 *1208M* 32388K ucond 0 0:01 0.00% java
    1G for simple script? this is when it just waiting and not sending mail. How it can be optimized?
    2DrClap I prefer to name it daemon because it runs and lives permanent and not using cron. I dunno about threads, but i believe if we will send ~10k and more emails per hour, would be better to use threads, I don't want situation when client registering on site and waiting for five mins when activation email arrives. And as I mention above and as you can see in script we use Mongo, its fast. Really fast. I generate 100k emails for test in ~1 second. So Mongo isn't bottleneck and will never be.

  • Classpath settings of java for fedora5.0

    Hello All,
    I've just switched from windows to fedora5.0(linux), and have no knowledge how and from where i've to set classpath for java. Java comes inbuild with this OS, but what version it is?????any help either the full procedure or some helpful links will be greatly appreciated......thnx in adv.

    In the past, one of the major criticisms of Linuxhas
    been that it has been difficult for Jo Public touse.
    As a consequence, the move in Linux has beentowards
    ease of use and making the interface for Jo Public
    use the same metaphors as Windows. So, from a
    cosmetic point of view, Linux distributions have
    started to look like Windows BUT beneath thesurface
    they are still Linux.
    I like FCx.But from a developer's point of view, I don't think
    FC should be the choice. Developer's are here to
    learn a lot. I learnt a lot about how things actually
    go at the OS level after using linux which windows
    never provides. If everything is abstracted by FC
    through that UI, a developer will turn sluggish and
    never care to exploit the power of linux. I don't buy this. I use Linux for development and I use bash, Perl, Python, sed, awk, emacs etc etc etc. One does not have to use all these tools but if a developer wants to he can - he is not forced to use just the Windows like features.
    >
    Slack I always felt was made for developersl and a
    lot more stable than FC. Suse is more on the UI
    side, but it's as good as slack.I like UNIX/Linux. I currently use Ubuntu as my primary Linux but have installed though WMWare CentOS, Foresight, Slackware, FC7 and FreeBSD. I also have Windows XP and Windows 2000 installed though VMWare. I develop on Ubuntu and mainly use the other Linux/UNIX version to test my software.
    My favorite Linux version is FC7 and I will probably move back to using it as my primary in the near future. I hated the install of Slackware and FreeBSD - they are so old-fashioned.

  • ClassNotFoundError running application on freebsd

    Hello to all,
    I have a simple jar application that uses log4j library.
    I want to run this application on a freebsd machine (6.3) with java 1.5. installed.
    - I put log4j jar in the same folder where there is my application jar
    - i digit java -classpath ./<log4jJarName> -jar MyAppl.jar
    but it doesn't work. I get a ClassNotFoundExcetion at the first code line where a log4j class is used.
    any idea????
    thank you!
    Luke

    bsd# java -classpath ./log4j-1.2.13.jar -jar MyApp.jar ./file.log 10
    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/PropertyConfigurator
            at MyApp.main(MyApp.java:109)
    bsd#if I comment that line the error occurs at the next line where a log4j class is used.
    but log4j jar is in the same folder as the application
    and I'm running as root
    Thank you
    Luke

  • Help tracking down a file descriptor leak under java 6

    I have a large application I work on that runs fine under java5 (apart from possibly the latest update) but running under java 6 results in file descriptors used for TCP sockets being leaked.
    I'm testing this under FreeBSD 6 (both i386 and amd64) using diablo JDK and a port build jdk-1.6.0.3p3 but I have had reports from other users of exactly the same issue under various linux distributions. There are some reports that going back as far as 1.6.0b5 will resolve the issue but no later version works and a few reports that the latest 1.5 updates have the same issue.
    This application is using standard IO so Socket/ServerSocket and occasionally SSLSocket, no NIO is involved. Under the problem JDKs it will run for a while before available FDs are exhausted and then fall over with a "too many open files" exception. So far I have been unable to recreate the situation in a simple testcase and the fact it works fine under earlier JDKs is really causing me issues with deciding where to look for the issue.
    Using lsof to watch the FDs that are leaked I see a steadily increasing number shown in the following state:
    java 23438 djb 54u IPv4 0xffffff0091ad02f8 0t0 TCP *:* (CLOSED)
    java 23438 djb 55u IPv4 0xffffff0105aa45f0 0t0 TCP *:* (CLOSED)
    java 23438 djb 56u IPv4 0xffffff01260c15f0 0t0 TCP *:* (CLOSED)
    java 23438 djb 57u IPv4 0xffffff012a2ae8e8 0t0 TCP *:* (CLOSED)
    If these were showing as say (CLOSE_WAIT) then I would understand where they are coming from but as far as I understand the above means the socket has been fully closed but the FD simply hasn't been released. I'm not an expert on the TCP protocol however so I may be wrong here.
    I did try making the application set SoLinger(0,true) on all sockets which of course made all connecting clients think the connection was aborted rather than gracefully closed but even with this setting the FD leak persisted.
    I've gone as far as looking at what I think are the relevant parts of the src for both JDK versions I am using but there are very few changes and nothing that obviously looks linked.
    I'm fully prepared to spend a lot of time looking into this and I'm sure I'd eventually find the cause but if anyone here already knows what the answer may be or can simply give me a nudge in the best direction to look I would be very grateful.

    After weeks of dancing around the issue for weeks, we narrowed it down to garbage collection. If we put System.gc() to run periodically , file descriptors get garbage collected properly . I've tried playing with the settings by using XX:+UseConcMarkSweepGC which seems to help a great deal while system is under stress. However when there is light activity.. the file descriptors grow again and eventually bring everything down.
    Any clues ? is there any way to make gc to perform full collection more often ?
    pls whelp !!!

  • NEWBIE question about java

    Why is the java compiler making two .class files for my swing applet?
    input > applet1.java
    output> applet1.class , applet1$1.class
    This is annoyin because it appears the applet1.class needs applet1$1.class
    to run. Unfortunately, my webserver (FreeBSD) doesn't support $ characters in filenames,
    converting the second file to applet1_1.class

    Yes, I do have an anonymous listener...
    import java.io.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.util.*;
    import java.net.*;
    public class applet1 extends JApplet
        JLabel label1 = new JLabel("Please enter street address of organization here");
        JLabel label2 = new JLabel("Enter unique ID here");
        JTextField textbox1 = new JTextField();
        JTextField textbox2 = new JTextField();
        JButton button1 = new JButton("Submit");
       public void init(){
          Container c1 = getContentPane(); 
          GridBagLayout gridbag = new GridBagLayout();
          GridBagConstraints constraints = new GridBagConstraints();
          c1.setLayout(gridbag);
          constraints.weighty = 1;
          constraints.fill = GridBagConstraints.NONE;
          constraints.weightx = 1;
          constraints.anchor = GridBagConstraints.WEST;
          gridbag.setConstraints(label1,constraints);
          c1.add(label1);
           constraints.fill = GridBagConstraints.HORIZONTAL;
           constraints.gridwidth = GridBagConstraints.REMAINDER;
           gridbag.setConstraints(textbox1,constraints);
           c1.add(textbox1);
            constraints.weightx = 1;
                       constraints.gridwidth = GridBagConstraints.WEST;
            gridbag.setConstraints(label2,constraints);
            c1.add(label2);
           constraints.weightx = 1;
                     constraints.gridwidth = GridBagConstraints.REMAINDER;
           gridbag.setConstraints(textbox2,constraints);
           c1.add(textbox2);
           constraints.fill = GridBagConstraints.NONE;
           constraints.gridwidth = GridBagConstraints.REMAINDER;
           constraints.anchor = GridBagConstraints.CENTER;
                      gridbag.setConstraints(button1,constraints);
           c1.add(button1);
    button1.addActionListener(new ActionListener()
        public void actionPerformed(ActionEvent event)
            int i=0;
            int f=0;
            Date myDate = new Date();
            int day = myDate.getDate();
            int month = myDate.getMonth() + 1;
            int code = Integer.parseInt(textbox2.getText());
            boolean matchFound=false;
            String h = (new String(textbox1.getText()).substring(0,10));
            String str;
            //search database
            try{
                URL url = new URL(getCodeBase(), "address.txt");
                InputStream inStream = url.openStream();
                BufferedReader br = new BufferedReader(new InputStreamReader(inStream));
                StringBuffer l = new StringBuffer(10);
                StringBuffer r = new StringBuffer(20);
                while((str = br.readLine())!=null){
                r.append(str);
                //take out spaces
                for (i=1;i<r.length();i=i+2)
                    l.append(r.charAt(i));
                if (h.equalsIgnoreCase(l.toString().substring(0,10))){
                       //we have a match
                       matchFound =  true;
                //clear buffers for next record
                r.setLength(0);
                l.setLength(0);
                br.close();        
                inStream.close();
                if (matchFound==true)
                    //if match found, perform date conversion
                    day = (code/month)/day;
                    textbox2.hide();
                  textbox1.hide();
                  button1.hide();     
                   label1.setText("Confirmed! Use this number to unlock: ");
                    label2.setText(String.valueOf(day));
                else
                textbox1.setText("Address not found");
            catch (Exception e)
                textbox1.setText("Data file missing");
    }

  • Solaris 10 (x86) + XDMCP + Java = No Num keypad

    Hi all,
    I have a Solaris 10 Server running on Sun Fire hardware. Users login via XDMCP and use a WYSE Linux Based terminal to connect to the Sun Server. From inside the terminal numlock works as you would imagine it should. However when running a Java Applet, If the user presses Numlock, the Backspace and Delete keys stop working and the numeric keys do not activate.
    This only affects Java Applet based applications and does not effect apps like Star Office.
    Running JRE/JDK 1.5.0_06 with Java Desktop 3
    Windows users running the same applet combo do not exhibit this problem nor is it native on the console. It only exists through things like CygwinX, ReflectionX, KEAX or any hardware based XTERM.
    I have read http://www.freedesktop.org/wiki/CygwinXTroubleShooting which suggests this is an existing historical Solaris problem

    This bug also surfaces in FreeBSD's port of JDK 1.5.0. With Num Lock switched on, Backspace and delete keys don't work, nor for that matter does Tab, (or Shift-Tab, or the cursor keys, Home, End, Page Up or Page Down... In fact, any non-meta key that happens to be coloured grey on my keyboard. To delete, I have use to Ctrl-H, which is nice if I want to be reminded of teletype days, but not nice these days.
    Switch Num Lock off, and you lose use of the Number pad for numbers, but the usual functionality for the grey keys on the keyboard returns.
    I spotted it the other day on a Solaris 10 x86 machine, and couldn't believe that it surfaces there as well, so it's obviously a core bug that both the Solaris build and FreeBSD build is affected by.

Maybe you are looking for

  • Inventory in Warehouse Report PLD

    Hi, I am trying to revise the print template for this report (Normal display). We want to show all 11 of our warehouses, but the default system layout only shows up to the first 5 warehouses. In addition, the fields which show the warehouse code and

  • How to for JTextField and JButton..

    How can i set the size of the JTextField and getting the words alignment to be in Center format?? Can i use JButton, click on it and key in value to be displayed in text form?

  • Ical iCloud error message

    previously working ical and iCloud now giving me a "500" error to operation CalDAVAccountRefreshQueueableOperation The fix is.....? bgmdfaap

  • Need plug in driver for Motorola Entice w766

    Hi there. I need a driver or plug in for my Motorla Entice w766. Motorola, Mac, and any third party I've found doesn't support my phone, has anyone or can anyone find a driver so I can sync my phone to my Mac? Thanks, Matt

  • Locked or Password Protected Printing

    Hello: Is it possible to print from a MAC using a password protected or locked print job that can only be retrieved by the sender at a network printer? If so, how is this done on a MAC?