install jdk in ubuntu( please notice diffrent verstion and change the name in the configuration)
2012-01-09 18:07
537 查看
2.选择安装 openjdk-6-jdk(.........)
apt-get install openjdk-6-jdk
3.文件都装那里去了呢?
搜寻了一下发现文件安装在 :/usr/lib/jvm/java-6-sun-1.6.0.03 下了。
/usr/lib/jvm/java-6-sun 是/usr/lib/jvm/java-6-sun-1.6.0.03 的符号链接4.设置JAVA_HOME变量
编辑/etc/profile文件,添加如下内容:
我们可以象下面这样写一个超简单的 helloworld 程序文件: HelloWorld.java
//文件名:HelloWorld.java
public class HelloWorld
{
public static void main(String[] args)
{
System.out.println("HelloWorld!");
}
}
在你的 HelloWorld.java 目录下依次执行:
sudo /usr/jdk1.6.0_21/bin/javac HelloWorld.java(...........)
java HelloWorld
apt-get install openjdk-6-jdk
3.文件都装那里去了呢?
搜寻了一下发现文件安装在 :/usr/lib/jvm/java-6-sun-1.6.0.03 下了。
/usr/lib/jvm/java-6-sun 是/usr/lib/jvm/java-6-sun-1.6.0.03 的符号链接4.设置JAVA_HOME变量
编辑/etc/profile文件,添加如下内容:
JAVA_HOME=/usr/lib/jvm/java-6-sun (............) export JAVA_HOME 注意,保存后重新登录,这个环境变量就生效了。5、测试
我们可以象下面这样写一个超简单的 helloworld 程序文件: HelloWorld.java
//文件名:HelloWorld.java
public class HelloWorld
{
public static void main(String[] args)
{
System.out.println("HelloWorld!");
}
}
在你的 HelloWorld.java 目录下依次执行:
sudo /usr/jdk1.6.0_21/bin/javac HelloWorld.java(...........)
java HelloWorld
相关文章推荐
- ubuntu install problem the configuration defaults for gnome power manager have not been installed correctly,please contact your
- GlassFish v3 requires a JDK 1.6 and not a JRE. Please add/select the correct JDK in the Server prope
- Cannot initialize Cluster. Please check your configuration for mapreduce.framework.name and the co
- Cannot initialize Cluster. Please check your configuration for mapreduce.framework.name and the correspond server addresses.
- download and install the jdk1.8 on ubuntu14.4
- Please make sure the -vm option in eclipse.ini is pointing to a JDK and verify that Installed JRE’s are also using JDK installs
- Please make sure the -vm option in eclipse.ini is pointing to a JDK and verify that Installed JRE’s
- 解决Cannot initialize Cluster. Please check your configuration for mapreduce.framework.name and the co
- Please make sure the -vm option in eclipse.ini is pointing to a JDK and verify that Installed JRE’s
- Maven打包异常Unable to locate the Javac Compiler in:Please ensure you are using JDK 1.4 or above and
- Please make sure the -vm option in eclipse.ini is pointing to a JDK and verify that Installed JRE’s
- SecureCRT通过SSH服务登录ubuntu出错:Password authentication failed, Please verify that the username and passw
- Install Faience Theme and Icons in Ubuntu 12.04
- ubuntu PPA ERROR(Please check that the PPA name or format is correct)
- Please enter the correct username and password for a staff account. Note tha
- install eigen in ubuntu and use it in qt
- install the Mondo Rescue utility in Ubuntu 12.04 or 12.10.
- [Ubuntu] Invalid command 'VirtualDocumentRoot', perhaps misspelled or defined by a module not included in the server configuration
- virtualbox报错,Please install the virtualbox-ose-dkms package and execute 'modprobe vboxdrv' as root
- Download and Install AndroidSDK in Ubuntu 12.04 (Precise Pangolin)