How to Install Portable Java Runtime Environment on USB
Most computer users have heard of the Java programming language because it will be installed on a lot of machines and required on some websites. One good thing about Java is it’s cross platform and runs in it’s own self contained virtual machine, meaning the same applets and programs can be run on different operating systems such as Windows, Linux and Mac OS without using different code.
Some users claim it slows their computer down because of the extra processes loading with Windows such as the Quick Starter process jqs.exe. One thing a Java install does do which annoys a lot of people is leave the previous versions in place to supposedly help with compatibility. The small utility JavaRa was designed to help clean out any old installation files. Exploits do appear from time to time which can potentially allow malware to be installed onto a computer if the user clicks the Yes button when visiting a website created by a hacker, but these exploits are rare and fixed pretty quickly.
Although the Java Runtime Environment (JRE) package requires installation and there is no official portable version, it is still possible to run applets and applications without installing Java into Windows. An unofficial portable version from PortableApps.com allows you to copy Java to your USB flash drive or hard drive folder and run it from there. Here’s a guide on how to do that.
1. First insert a USB flash drive into your computer. For this example the letter of our USB flash drive is the F: drive. Obviously substitute F: for your own drive letter.2. Download Java Portable from PortableApps.com. Once finished downloading, run the downloaded executable file and click OK -> Next -> I Agree and then you’re asked to choose an install location. By default the destination folder will show {path}\CommonFiles\Java, add F: at the front so that it becomes F:\CommonFiles\Java and click the Install button. The latest Java installer will download which is currently around 30MB.
3. When the Portable setup has finished, download and run the PortableApps.com jPortable Launcher tool which is a small program that can execute Java .JAR files. During the install take note of the destination folder again. Add F: in front so that the destination folder becomes F:\JavaPortableLauncher and click the Install button.
4. To run a Java applet or application, open the F: drive and execute the F:\JavaPortableLauncher\JavaPortableLauncher.exe file which will open a file dialog asking you to select the .JAR file of the applet or program you want to run. If you are getting a “jPortable Launcher cannot be started…” error, it means that you installed Java Portable at the wrong location in step 2. Make sure that it is installed in {drive:}\CommonFiles\Java.
You cannot use this method with currently installed software that requires Java to function like LibreOffice or jDownloader or Java applets in web browsers. If you try to open a webpage in an installed browser which requires Java then you’ll just be told it needs to be installed. The torrent client Vuze/Azureus did at least ask for the location of the Java files on install and worked using the portable Java.
The good thing is PortableApps.com have made this version of Java compatible with their portable applications that require or use Java such as LibreOffice or Firefox. Just make sure to have CommonFiles in the same folder as the portable application folder, e.g; F:\folder1\CommonFiles\Java and F:\folder1\FirefoxPortable.
The hugely popular download manager jDownloader is programmed in Java and will obviously need a Java runtime installation to work. Although not officially available at PortableApps.com, it can easily be used in a portable way with the above method. Simply download the MultiOS zip file from “Other” on the jDownloader download page and extract it to your USB flash drive or hard drive folder. Now simply launch JavaPortableLauncher and locate the jDownloader.jar file.
To launch jDownloader directly from a shortcut so you don’t need to open the JAR file manually every time requires a few extra steps, you need to:
1. Copy the contents of the JavaPortableLauncher folder to the jDownloader folder.
2. Create a shortcut of JavaPortableLauncher.exe, right click on the shortcut -> Properties, then append “jDownloader.jar” in the Target box. Create the shortcut AFTER copying the jDownloader folder to its final location or the paths in the shortcut will be incorrect.
The CommonFiles folder HAS to be one folder level up from where you have placed the JavaPortableLauncher.exe. For example, if you have:
“D:\Portable Tools\jDownloader\jDownloader\JavaPortableLauncher.exe”
The CommonFiles folder will be:
“D:\Portable Tools\jDownloader\CommonFiles”
Using this method you can have a portable jDownloader folder with Java included which can be placed in any hard drive folder or external USB drive. Obviously you can do this with many other Java based applications not just jDownloader.
replaced 1 installation by another …. wow.
Even though it could be tolerated as a means to an end, I dont trust that the jlauncher works as desired, because the his developer does not appreciate the portable concept for his own creations.
Ray,, great stuff. never saw your sight till the last year,but seems every 4th thing i search,you have a solution lately.well done.,you should start a BLOG(joking),great stuff,the right solutions,riight tools,right content,that actually solve something useful.
Great STUFF.
THANK YOU for taking the time.
It is possible to do it with DocFetcher? There is no DocFetcher.jar, just DocFetcher.exe…
Much easier with DocFetcher. All you have to do is download java port and place it in the same folder as doc fetcher. Then:
2º) Move docFetcher.bat from the “misc” folder one level up into the DocFetcher folder.
3º) Edit docFetcher.bat and add the path where your portable java is located. Let’s say its in E:\BUSQUEDAS\DocFetcher-1.1.12\Java\bin\java, you have to replace “java” in
java -enableassertions -Xmx512m -Xss2m -cp %libclasspath% -Djava.library.path=lib net.sourceforge.docfetcher.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
by your path. So the result would be:
E:\BUSQUEDAS\DocFetcher-1.1.12\Java\bin\java -enableassertions -Xmx512m -Xss2m -cp %libclasspath% -Djava.library.path=lib net.sourceforge.docfetcher.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
4º) Double click the docFetcher.bat to launch docFetcher.
Now you can go a bit further an convert the bat to an exe so you can give it an icon and pin it to the task bar
.
For one solid week I’ve been trying to java and netbeans portable to run from my flashdrive. Is this possible if the host computer doesn’t have a specific version of java or java installed at all. How would one does this successfully? Do I need to specific version of portable netbeans? because I found portable netbeans 8.0 but I need help…everytime I try to run netbeans it comes up with “Cannot locate java installation in specific jdkhome: D:\Portable Apps\NetBeans_JavaSE_8.0_Portable\App\jdk”
Do you want to try to use the default version?
And then it says “Cannot find Java 1.7 or higher”
I’m very confused, can someone please help me?
Thanks for this Ray. ;)
Thanks, now I got an idea of deploying Java application to all my desktop remotely.
Good one Ray!!
Thanks for the info…