Powered By Blogger

Friday, October 21, 2011

"JDK " STEP BY STEP install

If the images on this page are not clear, right-click on the image and choose View Image to see a larger rendition.
1
As the symkey user, download the free JDK 5.0 – also known as J2SE5 - from Sun's website and store it in a temporary directory (c:\tmp). Download the standalone version of the J2SE and not the ones bundled with NetBeans or with Java EE. The instructions below apply only to the standalone version of the JDK.
2
If you are in a country where it is available, download the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 5.0 from the same page on the website. Save this file in the temporary directory (c:\tmp). If you cannot download this file, you will not be able to use any symmetric key whose size is greater than 128-bits.
3
Go to the c:\tmp directory and install the JDK by executing the downloaded binary file using
jdk-1_5_0_0x-windows-i586-p.exe
You should see the start of the installation wizard:




4
Select I accept the terms in the license agreement and click Next to continue. You should see:




5
Select the little pull-down icon next to Demos and select Don't install this feature now.
6
Do the same for Source Code and Public JRE. These are not needed for StrongKey. Your panel should look like the following




7
Click the Change... button on the panel. You should see:




8
Change the default Folder name to C:\usr\local\jdk1.5.0_0x\ and click OK. You may need to click on Development Tools first before the Change... button is activated. You should see:
Note: The \usr\local\jdk1.5.0_0x directory does not exist at this stage, so you will not be able to select it from the GUI. You will have to type it in into the Folder Name field at the bottom of the wizard, as shown below.




9
Click Next to continue. You should see a Progress panel that takes a few minutes to go through the installation.




10
When the installation is complete, you should see the following




11
Click Finish to exit the wizard.
12
To add the Java executable to your Command Prompt path, open the Control Panel (from Start->Control Panel)
13
Select the System option and open its dialog panel. You should see




14
Choose the Advanced tab. You should see




15
Click on Environment Variables. You should see




16
Slide the slider in the System variables section till you see the Path variable. Highlight it, as follows:




17
Click on the Edit button. You should see




18
Press the Home key on your PC to go to the beginning, and add the following to the Variable value
c:\usr\local\jdk1.5.0_0x\bin;
When completed, it should resemble the following




19
Click OK to exit the Edit System Variable panel.
20
Click OK again to exit the Environment Variables panel.
21
Click OK to exit the System Properties panel.
22
Finally, exit the Control Panel.
23
Open a new Command Prompt window, and type the following:
java -version
You should see the following




24
This indicates you have installed the JDK successfully.
25
Using the Windows Explorer, open the jce_policy-1_5_0.zip file. You should see




26
Select jce to explore that folder. You should see
Note: Depending on the view of your Explorer, you might see this as a List, or Icons or Detailed List. Regardless of the view, please select the local_policy.jar and the US_export_policy.jar files for copying.




27
Select the two files – local_policy.jar and US_export_policy.jar – and copy them (either by typing Ctrl-C together, or by choosing Edit->Copy from the menu)
28
Navigate the explorer to the c:\usr\local\jdk1.5.0_0x\jre\lib\security folder and paste the copied files (either using Ctrl-V together or by choosing Edit->Paste from the menu. You should see




29
Click on Yes to All. You should see the following




30
From the same explorer window, click on java.security. If the file does not automatically open in WordPad, you should see:




31
Choose Select the program from a list and click on OK. You should see




32
Slide the slider down and select WordPad and click OK. You should see the text file open up inside the WordPad window.
33
Find the following section and add the line highlighted in red color in this instruction to the previous security.providers in the file. (You should already have six JCE providers in the default JDK installation):
#
# List of providers and their preference orders (see above):
#
security.provider.1=sun.security.provider.Sun
security.provider.2=sun.security.rsa.SunRsaSign
security.provider.3=com.sun.net.ssl.internal.ssl.Provider
security.provider.4=com.sun.crypto.provider.SunJCE
security.provider.5=sun.security.jgss.SunProvider
security.provider.6=com.sun.security.sasl.Provider
security.provider.7=sun.security.pkcs11.SunPKCS11 /usr/local/etc/symkey/pkcs11/jdk5-nss-windows.cfg
Bear in mind that each provider is on a separate line, and that the line for provider #7 is really one, unbroken line. To avoid typographical errors, please copy the red line and paste it into your java.security file. Your finished edit should look like the following:




34
Save the file. You should see the following warning




35
Select Yes and exit WordPad.
36
Display the c:\usr\local\etc/symkey\pkcs11\jdk5-nss-windows.cfg file and review its contents. One of the lines in there states:


library = /Program Files/Mozilla Firefox/softokn3.dll
37
Verify that you do have such a file in that location on your machine in the C:\Program Files\Mozilla Firefox directory. If it does not, then it is probably because you do not have Firefox installed. In this case, please install Firefox 1.5.x first, and continue from step #36 above. You can get Firefox for free at http://www.mozilla.com/firefox.
38
Using the steps described from step #13 to step #22, add the C:\Program Files\Mozilla Firefox directory to the PATH variable of your environment. The only difference is that where you added the JDK path to the environment earlier, you will add the Firefox path this time.
39
After you have successfully added the Firefox directory to your PATH, open a new Command Prompt window and type
set


You should see a number of environment variables and their values displayed on the screen.


Find the PATH environment variable and ensure that the Firefox directory location is in it. If not, please retrace step #38 to ensure you have the correct location in the PATH variable).


If the library is available in the location specified by the library parameter in the jdk5-nss-windows.cfg file, then it is OK.
40
At this point, you have successfully installed the JDK.