Earlier this year many Java related vulnerabilities were discovered by security researchers. Some of them were so severe that many security companies like avast!, ESET, Trend Micro, Symantec etc., advised everyone to either completely uninstall Java from Windows or disable it from their web browsers. Although those vulnerabilities have been patched but many experts still tell people to be careful about Java. A better and more secure way to run Java based apps is to use the portable Java called jPortable. This way you do not have to install anything on your system and you run Java only when required.
You can download jPortable from the PortableApps website. The download is available as a portable application both for the 32-bit and 64-bit versions of Windows. The downloaded file is about 5 megabytes in size, but it further downloads the JRE from the Oracle website. This JRE download is done only for the first time. If you have the full JRE installer then you can place it in the same folder as the jPortable installer and it will use this JRE instead of downloading it from the Internet.
Once it has downloaded and extracted the JRE to a folder on your USB key, you can start using Java for any program you like. For example, some features of the OpenOffice require you to have Java installed. Instead of installing Java on your system, you can add the path to the JRE folder on your USB key to your system paths. To add the path to your system environment variables, press the Win + Pause shortcut, select Advanced system settings and click on Environment Variables. In the window that opens up, you can append the folder path to JRE to your PATH variable.
Some portable apps do not need even the system path modification. They automatically detect presence of JRE on the USB key and run without any problems. You can also use the command line to start a Java program. To do this, you have to open the command prompt and give the command using the java.exe or javaw.exe programs.
If all this looks very complicated to you, then the PortableApps website has created jPortable Launcher using which you can run any Java Jar program. When you run jPortable Launcher, it asks you for selecting the Jar file which it launches immediately. This is certainly better than using the command line interface.
You can download jPortable from http://portableapps.com/.