ubuntu 12.04 下安装oracle java7 方法
错 误如下所示 : Download done.sha256sum mismatch jdk-7u3-linux-x64.tar.gzOracle JDK 7 is NOT installed.dpkg:处理 oracle-java7-installer (--configure)时出错:子进程 已安装 post-installation 脚本 返回了错误号 1在处理时有错误发生:oracle-ja
错误如下所示:
Download done. sha256sum mismatch jdk-7u3-linux-x64.tar.gz Oracle JDK 7 is NOT installed. dpkg:处理 oracle-java7-installer (--configure)时出错: 子进程 已安装 post-installation 脚本 返回了错误号 1 在处理时有错误发生: oracle-java7-installer E: Sub-process /usr/bin/dpkg returned an error code (1)
经过一番查找,在http://forum.ubuntu.org.cn/viewtopic.php?f=48&t=372892论坛中的9楼的方法是正确的。现贴出如下:
sudo rm /var/lib/dpkg/info/oracle-java7-installer* sudo apt-get purge oracle-java7-installer* sudo rm /etc/apt/sources.list.d/*java* sudo apt-get update sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java7-installer
有时用上面的也会出现同样的错误,主要是如果在下载过程中自动中断了,接下来就会出现同样的错误。
错误的解决方法如下:
1、下载linux安装文件:
到官网下载jdk-7u3-linux-x64.tar.gz文件
2、替换
用下载的文件/var/cache/oracle-jdk7-installer目录下jdk-7u3-linux-x64.tar.gz文件
3、修改/var/lib/dpkg/info/oracle-java7-installer.postinst
注释掉文件中
echo “Downloading…”到echo “Download done”中间的部分。
4、重新安装
sudo apt-get install oracle-java7-installer
OK 搞定!
方法二:手动配置环境
这个在windows下只是安装exe的过程,在ubuntu下已不见得过于复杂,一般了解Java环境配置的,都理解下面的步骤意义:
1. 从oracle官网下载新版jdk的文件,将下载的文件放到/usr/lib/jvm/java中,并解压,ok,jdk已安装完毕!
2. 环境变量配置
在终端执行命令: sudo vi /etc/environment,红色部分为添加的信息:
JAVAHOME=/usr/lib/jvm/java/jdk1.7.0_04 PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/java/jdk1.7.0_04/bin:/usr/lib/jvm/java/jdk1.7.0_04/jre/bin" CLASSPATH=/usr/lib/jvm/java/jdk1.7.0_04 /lib:/usr/lib/jvm/java/jdk1.7.0_04/jre/lib
有时
接着设置默认的jdk,因为系统默认可能存在别的jdk
在终端执行命令:
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java/jdk1.7.0_04/bin/java 300
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java/jdk1.7.0_04/bin/javac 300
选择系统默认的jdk,在终端执行命令: sudo update-alternatives --config java
如果只存在一个java环境则会出现提示系统只有一个jdk
最后执行命令: java -version
java version "1.7.0_04" Java(TM) SE Runtime Environment (build 1.7.0-b04) Java HotSpot(TM) Client VM (build 15.2-b04, mixed mode, sharing)
此时显示使用的Java是sun的Java,ok,环境变量设置成功

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



To query the Oracle tablespace size, follow the following steps: Determine the tablespace name by running the query: SELECT tablespace_name FROM dba_tablespaces; Query the tablespace size by running the query: SELECT sum(bytes) AS total_size, sum(bytes_free) AS available_space, sum(bytes) - sum(bytes_free) AS used_space FROM dba_data_files WHERE tablespace_

Oracle View Encryption allows you to encrypt data in the view, thereby enhancing the security of sensitive information. The steps include: 1) creating the master encryption key (MEk); 2) creating an encrypted view, specifying the view and MEk to be encrypted; 3) authorizing users to access the encrypted view. How encrypted views work: When a user querys for an encrypted view, Oracle uses MEk to decrypt data, ensuring that only authorized users can access readable data.

Data import method: 1. Use the SQLLoader utility: prepare data files, create control files, and run SQLLoader; 2. Use the IMP/EXP tool: export data, import data. Tip: 1. Recommended SQL*Loader for big data sets; 2. The target table should exist and the column definition matches; 3. After importing, data integrity needs to be verified.

Uninstall method for Oracle installation failure: Close Oracle service, delete Oracle program files and registry keys, uninstall Oracle environment variables, and restart the computer. If the uninstall fails, you can uninstall manually using the Oracle Universal Uninstall Tool.

There are three ways to view instance names in Oracle: use the "sqlplus" and "select instance_name from v$instance;" commands on the command line. Use the "show instance_name;" command in SQL*Plus. Check environment variables (ORACLE_SID on Linux) through the operating system's Task Manager, Oracle Enterprise Manager, or through the operating system.

There are the following methods to get time in Oracle: CURRENT_TIMESTAMP: Returns the current system time, accurate to seconds. SYSTIMESTAMP: More accurate than CURRENT_TIMESTAMP, to nanoseconds. SYSDATE: Returns the current system date, excluding the time part. TO_CHAR(SYSDATE, 'YYY-MM-DD HH24:MI:SS'): Converts the current system date and time to a specific format. EXTRACT: Extracts a specific part from a time value, such as a year, month, or hour.

An AWR report is a report that displays database performance and activity snapshots. The interpretation steps include: identifying the date and time of the activity snapshot. View an overview of activities and resource consumption. Analyze session activities to find session types, resource consumption, and waiting events. Find potential performance bottlenecks such as slow SQL statements, resource contention, and I/O issues. View waiting events, identify and resolve them for performance. Analyze latch and memory usage patterns to identify memory issues that are causing performance issues.

SQL statements can be created and executed based on runtime input by using Oracle's dynamic SQL. The steps include: preparing an empty string variable to store dynamically generated SQL statements. Use the EXECUTE IMMEDIATE or PREPARE statement to compile and execute dynamic SQL statements. Use bind variable to pass user input or other dynamic values to dynamic SQL. Use EXECUTE IMMEDIATE or EXECUTE to execute dynamic SQL statements.
