網頁

顯示具有 技術---Oracle 標籤的文章。 顯示所有文章
顯示具有 技術---Oracle 標籤的文章。 顯示所有文章

2013年11月2日 星期六

JDK --- Install & Choose OpenJDK or Oracle JDK on CentOS x64

By default, the CentOS minimal installation doesn’t install any JDK as OpenJDK. If we need this component for executing Java program, how to install it?

Install OpenJDK and Use it by default
To confirm whether ever install the OpenJDK by using the rpm –qa | grep –E ‘^open[jre|jdk]|j[re|dk]’ or yum list installed | grep openjdk ,and realize whether exist a java symbolic link in the /etc/alternatives directory.ScreenShot004If ever install the OpenJDK, we can check what version locate on the RPM repository by using the yum list \*openjdk\* | grep openjdk command.ScreenShot001To install the Java Runtime Environment by using the yum install java-1.7.0-openjdk commandScreenShot005If we want to develop the Java program, we have to install the related package by using the yum install java-1.7.0-openjdk-devel commandScreenShot006To confirm the OpenJDK again by using the rpm –qa | grep –E ‘^open[jre|jdk]|j[re|dk]’ or yum list installed | grep openjdk ,we will found out the OpenJDK has already been installed and the java symbolic link exist in the /etc/alternatives directory.
ScreenShot001To find the location of the JAVA_HOME environment variable by using the update-alternatives --display java command. So does that we know the JAVA_HOME will be /usr/lib/jvm/jir-1.7.0-openjdk.x86_64ScreenShot003To remove # sign from the /etc/java/java.conf fileScreenShot004To set JDK environment variable in the /etc/profile file next to apply the setting by using the source /etc/profile commandScreenShot005To verify whether the path is right by using the echo $PATH and the java use OpenJDK version by using the java - - version are right.ScreenShot006To find the path of the Java executable file by using the which java command or the location of java link by using the whereis java command.ScreenShot002
Install Oracle JDK and Use it by default
If we want to use Oracle JDK, how to switch the JDK command from OpenJDK to Oracle JDK?
At first, we have to install Oracle JDK on the same platform (# 1) so that need to download this package from Oracle website.
Due to it fail to download the JDK package from Oracle by wget commandScreenHunter_05We still have to contact Oracle Java Archive for downloading it manually by clicking Java SE 6 link.ScreenHunter_01To select the right JDK version as Java SE Development Kit 6u45 ScreenHunter_02To choose Accept License Agreement optionScreenHunter_03To select the right file as jdk-6u45-linux-x64-rpm.bin because the JDK will install on CentOS x64 by RPM method.ScreenHunter_04To sign in by the registered Oracle account and password next to download this file if the authentication pass.ScreenHunter_05To set the executable permission to this binary file by using the chmod +x ./jdk-6u45-linux-x64-rpm.bin commandScreenHunter_06To extract the java archive file but not directly install it by using the ./jdk-6u45-linux-x64-rpm.bin –x commandScreenHunter_07To upgrade/Install JDK by using the rpm –Uvh jdk-6u45-linux-amd64.rpm command So does that by default Java will be installed to the /usr/java/jdk1.6.0_45 directory and it creates two links /usr/java/latest & /usr/java/defaultScreenShot003After the Oracle JDK package is installed,we need to configure each component as java by using the alternatives - - install /usr/bin/java java /usr/java/latest/jre/bin/java 20000 command and to tell the system that default java command has already switched to this by using the update-alternatives - - config java command.ScreenShot007To do the same step for javac by using the alternatives - - install /usr/bin/javac javac /usr/java/latest/bin/javac 20000 command and the update-alternatives - - config javac commandScreenShot009 To do the same step for javaws by using the alternatives - - install /usr/bin/javaws javaws /usr/java/latest/jre/bin/javaws 20000 command and the update-alternatives - - config javaws commandScreenShot008To do the same step for javaws by using the alternatives - - install /usr/bin/jar jar /usr/java/latest/bin/jar 20000 command and the update-alternatives - - config javaws commandScreenShot010To list the symbolic link in the /etc/alternatives directory by using the ls –lA /etc/alternatives/ command and realize that set the default command for Oracle JDK now. ScreenShot011To change JAVA_HOME environment variable from /usr/lib/jvm/java-1.7.0-openjdk.x86_64 to /usr/java/latest in the /etc/profile file next to apply the setting by using the source /etc/profile commandScreenShot012To verify whether the path is right by using the echo $PATH and the java use Oracle JDK version by using the java - - version command.ScreenShot014
Reference
:
(# 1).On 64 bit Linux platform, we have to install one 32 bit JDK or 64 bit JDK but cannot co-exist if install it by RPM.
If we have to install the different version on the same platform, it will be workaround method that one is by RPM and the other is by BIN to install into the distinct directory.

2012年5月6日 星期日

Install 64-bit Oracle Client on 64-bit Windows 7

Last time, I install 32-bit PowerPivot 2012 on 32-bit Windows 7 to replace PowerPivot 2010. When I open Excel 2010 and select PowerPivot item, the remind message show up and ask me whether want to upgrade the workbook.
ScreenHunter_02 May. 06 11.50Of course, you have to press “OK” button so that the PowerPivot workbook will be showed up. In the moment, I follow the previous activity to execute refresh worksheet for retrieving Oracle Data but the result fail.
ScreenHunter_01 May. 06 11.46In this Error Message, it give me a suggestion either upgrading to 64-bit version or increasing memory. I choose upgrading to 64-bit version because the original 32-bit environment before replace PowerPivot version is normal so that it will be not enough memory.

For 64-bit environment, I need to install 64-bit OS, Office 2010, PowerPivot and hotfix with up-to-date. When finish the related Microsoft Prerequisite, the Oracle Client need to be installed then.
ScreenHunter_05 May. 06 13.50Download “Oracle Database 11g Release 2 Client (11.2.0.1.0) for Microsoft Windows (x64) from Oracle Website and extract “win64_11gR2_client” compressed file to the selected folder. The extracted path will be “\client” and its setup file is under this path.
Executing "setup.exe” to begin the installation process of Oracle Client.
ScreenHunter_03 May. 06 13.21In Select Installation Type,select “Administrator” option next to click “Next>” button
ScreenHunter_06 May. 06 14.29Click “Next> “ button if we don’t need to select another language.
ScreenHunter_07 May. 06 14.29Keep the default Oracle Base and Software Location next to click “Next> “ button
ScreenHunter_08 May. 06 14.29If no any problem in Perform Prerequisite Checks, click “Finish” button to begin to install Oracle Client Software now.
ScreenHunter_09 May. 06 14.30The installation of Oracle Client almost is successful if no any surprise.
ScreenHunter_10 May. 06 14.52
In the moment, we need to add a “tnsnames.oRA” file under the installation path as “c:\app\davidwa_wang\product\11.2.0\client_1\network\admin\” for creating an entry in this file to allows the ODBC driver to establish network connections to an Oracle Database.
ScreenHunter_11 May. 06 14.54In this file content, need to define “Data Source Name”, "Host” (by FQDN or NETBIOS name or IP), “Port” (default = 1521) and “Service Name”
ScreenHunter_12 May. 06 14.55After saving this file and opening Excel 2010 to execute PowerPivot Data Refresh, its function will be normal now.
ScreenHunter_13 May. 06 15.15
Since 2010 Design by Davidwa
©Copyright Davidwa Inc. All rights reserved.