Java

Manually install the Java Runtime Environment

On October 16, 2012 Apple has started to disable Java applets in Mac OS X 10.6, 10.7 and 10.8:
https://support.apple.com/kb/DL1572
https://support.apple.com/kb/DL1573

If you installed any maintenance updates for Mac OS X after that date, Java applets won't work.

You have to download and install the Java Runtime Environment yourself from
https://www.java.com/en/

Taggings:

Enabling Java in Firefox 3.6

1. Since Firefox 3.6, the Java is treated just like all other plugins and no longer has a enable check box in Tools > Options > Content. We can enable or disable Java plugin (and also all plugins) via Tools > Add-ons > Plugins.

2. What if the Java plugin does not appear in Tools > Add-ons > Plugins (you can also checked it by typing about:plugins in the address bar). It means that you have to install Java (before you can use Java in your Firefox). Since Firefox 3.6 and later versions you need the Next-Generation Java™ Plug-In present in Java 6 U10 and later.
These are how you can do it in various operating system (taken from http://kb.mozillazine.org/Java):

On Mac OS X
You can use the Mac OS X Software Update feature to update Java.
Note: The Java Embedding Plugin is bundled with current Mac distributions of Mozilla browsers, including Firefox and SeaMonkey. This utility allows browsers other than Apple's Safari to use the most recent versions of Java on Mac OS X.

On Linux
1. Download the Linux version of the Java software.
2. When the download is finished, execute the .bin file as root and follow the prompts.
3. When the installation has completed, run this command in the plugins directory of your Firefox installation:
ln -s /your_path_here/java/j2re1.5.0/plugin/i386/ns7/libjavaplugin_oji.so libjavaplugin_oji.so
4. Firefox 3.6 and later need the Next-Generation Java Plug-In
See Manual Installation and Registration of Java Plug-in for Linux (at java.sun.com)
Run this command in the plugins directory of your Firefox installation to create a symbolic link to the Java plugin (replace xx with the current Java version):
ln -s /usr/your_path_here/java/jre1.6.0_xx/lib/i386/libnpjp2.so libnpjp2.so

On Solaris Intel
1. Install the Solaris Intel version of the Java JRE or SDK.
2. When the installation has completed, run this command in the plugins directory of your Firefox installation:
ln -s /your_path_here/jre/plugin/i386/ns610/libjavaplugin_oji.so .

On Windows
Automatic update: The Java Update feature automatically checks for updates in Windows 2000/XP/Vista at scheduled intervals and notifies you when an update is available so that you can install it. If you have administrative privileges, you can also check for updates yourself and install them from the Java Control Panel (Start -> Control Panel -> Java -> "Update" tab).

Manual install or update:
1. Go to Java.com and click on the Free Java Download button.
2. Click on the Download Now button to start the online installation.
3. Close and restart your browser after the installation is complete.
If you prefer an offline installation, go to the Java SE Downloads page (see above for links) select the Java SE Runtime Environment (JRE) and save the offline installer (e.g., "jre-6u10-windows-i586-p.exe" for JRE 6 Update 10) to any convenient location, close your browser and run the installer.

Important: Previous to JRE 6 Update 10, installing or updating to a newer Java version would add a new Java Runtime Environment (JRE) instead of replacing the existing version. For example, if you already have JRE 6 Update 7 installed and later install JRE 6 Update 10, you would end up with two JRE versions installed in separate directories. You can remove older Java versions via Windows Control Panel "Add or Remove Programs", to save disk space and because older versions often contain security vulnerabilities.

Starting with JRE 6 Update 10, future Java updates will patch the current version by default instead of adding an additional version. For example, if you previously installed JRE 6 Update 10 in the C:\Program Files\Java\jre6 directory, and in the future you install JRE 6 Update 14, the version 6u14 installer does not create a new directory. Instead, it updates the pre-existing "jre6" directory with the new 6u14 content (JRE Update 10 will no longer exist). This will prevent an accumulation of unused and potentially insecure older JRE versions.

Send SMS in Java

 You can use this free Java sample program to send SMS from your PC using GSM modem connected to your computer to your COM port. You also need to download and install the Java comm api from Sun.This program needs the following java files to function.1. SerialConnection.java (This file is used to connect to your COM port from your java program)2. SerialConnectionException.java (This file is for handling serial connection exceptions in your Java program)3. SerialParameters.java (This program is used to set your COM port properties for connecting to your com port from your java program)4. Sender.java (This is the program that implements runnable and sends SMS using the serial connection)5. SMSClient.java (This java class is the main class that can be instantiated in your own java program and called to send SMS. This program in turn will use all the above four files internally to send out your SMS). /*
*
* A free Java sample program
* A list of java programs to send SMS using your COM serial connection
* and a GSM modem
*
* @author William Alexander
* free for use as long as this comment is included
* in the program as it is
*
* More Free Java programs available for download
* at http://www.java-samples.com
*
*
* Note: to use this program you need to download all the 5 java files
* mentioned on top
*
*/
public class SMSClient implements Runnable{

public final static int SYNCHRONOUS=0;
public final static int ASYNCHRONOUS=1;
private Thread myThread=null;

private int mode=-1;
private String recipient=null;
private String message=null;

public int status=-1;
public long messageNo=-1;

public SMSClient(int mode) {
this.mode=mode;
}

public int sendMessage (String recipient, String message){
this.recipient=recipient;
this.message=message;
//System.out.println("recipient: " + recipient + " message: " + message);
myThread = new Thread(this);
myThread.start();
// run();
return status;
}
public void run(){

Sender aSender = new Sender(recipient,message);

try{
//send message
aSender.send ();

// System.out.println("sending ... ");

//in SYNCHRONOUS mode wait for return : 0 for OK,
//-2 for timeout, -1 for other errors
if (mode==SYNCHRONOUS) {
while (aSender.status == -1){
myThread.sleep (1000);
}
}
if (aSender.status == 0) messageNo=aSender.messageNo ;

}catch (Exception e){

e.printStackTrace();

}

this.status=aSender.status ;

aSender=null;

}
}  

Taggings:

Connect remotely located Java application and database using JBoss, EJB

The Java application which serves as client-side software should be implemented as form of JavaBeans which are serializable.  Server-side software should be adopted to EJB(Enterprise Java Bean) which uses JBoss application server to communicate with database and client-side software components.What is serialization:In computer science, in the context of data storage and transmission, serialization is the process of converting an object into a sequence of bits so that it can be persisted on a storage medium (such as a file, or a memory buffer) or transmitted across a network connection link to be "resurrected" later in the same or another computer environment.[1] When the resulting series of bits is reread according to the serialization format, it can be used to create a semantically identical clone of the original object. For many complex objects, such as those that make extensive use of references, this process is not straightforward.What is JBoss:JBoss Application Server (or JBoss AS) is a free software/open-source Java EE-based application server. Because it is Java-based, the JBoss application server operates cross-platform: usable on any operating system that Java supports. JBoss AS was developed by JBoss, now a division of Red Hat.

Taggings:

How Java RMI Works

RMI applications often comprise two separate programs, a server and a client. A typical server program creates some remote objects, makes references to these objects accessible, and waits for clients to invoke methods on these objects. A typical client program obtains a remote reference to one or more remote objects on a server and then invokes methods on them. RMI provides the mechanism by which the server and the client communicate and pass information back and forth. Such an application is sometimes referred to as a distributed object application

Distributed object applications need to do the following:
* Locate remote objects. Applications can use various mechanisms to obtain references to remote objects. For example, an application can register its remote objects with RMI's simple naming facility, the RMI registry. Alternatively, an application can pass and return remote object references as part of other remote invocations.
* Communicate with remote objects. Details of communication between remote objects are handled by RMI. To the programmer, remote communication looks similar to regular Java method invocations.
* Load class definitions for objects that are passed around. Because RMI enables objects to be passed back and forth, it provides mechanisms for loading an object's class definitions as well as for transmitting an object's data

The server calls the registry to associate (or bind) a name with a remote object. The client looks up the remote object by its name in the server's registry and then invokes a method on it. The receiver can download the definition of an object's class if the class is not defined in the receiver's Java virtual machine.
All of the types and behavior of an object, previously available only in a single Java virtual machine, can be transmitted to another, possibly remote, Java virtual machine. RMI passes objects by their actual classes, so the behavior of the objects is not changed when they are sent to another Java virtual machine. This capability enables new types and behaviors to be introduced into a remote Java virtual machine, thus dynamically extending the behavior of an application

Taggings:

Pages

Subscribe to Java