Core Java Technology Section Index | Page 2
How can i initiate a shutdown (CTRL+ALT+DEL) without using JNI on my Windows box?
You can call Runtime.exec() and execute rundll32.exe with a few parameters.
rundll32.exe shell32.dll,SHExitWindowsEx (to close the session)
rundll32.exe shell32.dll,SHExitWindowsEx 2 (to reboot...more
What is Kerberos? Can I use it from Java?
Kerberos is a trusted third party network authentication protocol, initially developed as a part of MIT's Project Athena. Kerberos was designed to provide exceptionally strong authentication using...more
What are the basic techniques for debugging mixed java and C++ code?
Debugging integrated Java and C/C++ code illustrates the two basic approaches using JNI (call C/C++ code from java, embed jvm in C/C++ code) and ways to debug both approaches using JPDA (jdb) and ...more
Can I run a JDK under FreeBSD?
Yes. Ports of the Sun JDK for FreeBSD are published at this site.
Can I cut, copy, and paste between AWT and other X applications under Linux?
Yes - sometimes it's easy, and sometimes not. X has two commonly used mechanisms for copying and pasting between applications, which can be a bit confusing:
The primary selection: this is typical...more
How do I convert HTML form data from ASCII/HTML representation to a true Java Unicode string?
How do I convert HTML form data from ASCII/HTML representation to a true Java Unicode string? I have a JSP that stores what should be a Unicode stream into a NCLOB. The insert happens fine, however...more
How can I show a progress bar while reading a file?
Here's a simple example of monitoring file read progress
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.FileInputStream;
impo...more
I need to receive PKCS12 files and obtain X509Certificates from them in order to extract information. How do I do this?
Keytool can read PKCS12 files as generated by Netscape. It will treat
them as a keystore. An example would be:
keytool -list -rcs -keystore myfile.p12 -storetype pkcs12 -password foobar
Due to...more
What is TMX?
TMX stands for Translation Memory eXchange. From the definition at TMX Format - Specifications: "The purpose of the TMX format is to provide a standard method to describe translation memory data ...more
Why has the -Xnoagent option gone away in JDK1.3.1?
That option is only meaningful with a JVM running green threads. JDK1.3.1 only ships a HotSpot JVM running native threads.
What causes the error "Can't connect to X11 window server"?
The Sun AWT classes on Unix and Linux have a dependence on the X Window System: when you use the classes, they expect to load X client libraries and be able to talk to an X display server. This ma...more
Where can I find the API documentation for Jini?
The documentation for the latest version of Jini (1.1) is bundled
with the software - you must download the entire package from
http://developer.java.sun.com/developer/products/jini/EAproduct.off...more
How do you write a Thread-Safe Singleton?
I have written plenty of non-thread-safe Singletons but it wasn't until recently when I tracked it down that I realized that thread-safety could be a big problem.
The problem is that in the typic...more
What's the difference between JavaScript and Java?
JavaScript is an object-oriented scripting language that allows you to create dynamic HTML pages, allowing you to process/validate input data and maintain data, usually within the browser. Origina...more
What are the differences between checked and unchecked exceptions?
A checked exception is any subclass of Exception (or Exception itself), excluding class RuntimeException and its subclasses.
Making an exception checked forces client programmers to deal with th...more