Posts Tagged ‘Intellij IDEA’

30 04 2011

Install Sun Java Runtime (JRE) in Ubuntu 11.04 via PPA

bigCat Posted in Linux - 3 Comments

http://www.liberiangeek.net/2011/04/install-java-run-time-jre-ubuntu-11-04-ppa/

Ubuntu Maverick Image

This simple tutorial shows you how to install Sun Java Runtime Environment (JRE) in Ubuntu 11.04 Natty Narwhal via PPA. If you have upgraded to Ubuntu 11.04 and Java is not installed, follow this tutorial to install it. Java is normally installed via Ubuntu Partner repository, but at the time of this writing, Ubuntu Partner repository wasn’t available in Natty. This is a work-around and should get you the latest version of Java in Ubuntu.

 

Getting started:

 

To get started, click on ‘Power –> System Settings’

 

natty_java_5

 

Next, select ‘System –> Ubuntu Software Center’

 

natty_java_1_3

 

Then select ‘Edit –> Software Sources’

 

natty_java_2_3

 

Next, select ‘Other Software’ and click ‘Add’. Then type type line below into the box and click ‘Add Source’

ppa:ferramroberto/java

natty_java_3_3

 

Back into Software Center search for and install ‘sun-java6-jre’

sun-java6-jre

natty_java_4_3

 

Enjoy!

17 04 2011

How to put IntelliJ IDEA on Ubuntu

bigCat Posted in Linux - 0 Comment

http://techbrew.net/articles/200711/how-to-put-intellij-idea-on-ubuntu/

 

I’ve been a user of the excellent IntelliJ Java IDE for 4 years on Windows. Even though the official Linux support by JetBrains is only for RedHat, you can also install IntelliJ fairly easily on Ubuntu. I’ve tested this with Xubunto 7.10 (Gutsy), Java 6, and IntelliJ 7. Here’s how to do it in four basic steps:

1) Get Java

Install the Java 6 JDK, which IDEA itself needs to run. (You can have other JDKs for your projects, but you’ll need this one to run IntelliJ itself.) For example, type this in a terminal:

sudo apt-get install sun-java6-jdk

Follow the prompts for root password, download confirmation, and eventually the Sun EULA to install Java itself. If it installed successfully, you should be able to type this at a prompt:

java -version

… to get several lines telling you the version of Java you have installed. If this doesn’t work, refer to Sun’s documentation on troubleshooting installations.

2) Get IntelliJ IDEA

Download the latest version of IntelliJ IDEA for Linux:

http://www.jetbrains.com/idea/download/index.html#linux

Once the download is finished, extract the archive using the correct filename according to your download. For example, to install IntelliJ in /usr/lib, do the following:

tar xfz idea-7.0.1.tar.gz ./usr/lib/

The IntelliJ installation will now be in a subdirectory indicating the build number, in the format “idea-xxxx”. In the case of IDEA 7.0.1, the app directory is “idea-7364“. (Once the extraction is done, you can delete the downloaded archive to conserve disk space if needed.)

3) Get Environmental

There are a couple of environment variables to be taken care of. First, you need to set a new environment variable that tells IntelliJ where your install of Java is. For example:

export JDK_HOME="/usr/lib/jvm/java-6-sun/"

Use the “env” command, or just “echo $JDK_HOME“, to verify the variable is set.

Next, you’ll need to edit /etc/environment with superuser rights in the editor of your choice, adding the idea-xxxx/bin directory to your PATH variable. For example, you can edit the environment with the GUI mousepad editor like so:

sudo mousepad /etc/environment

The various directories in the environment PATH variable are delineated by colons (:). Append the current value (inside the quotes) with a new colon and then add the idea-xxxx/bin location. It should look something like this:

PATH="/usr/local/sbin:/usr/local/bin:/usr/lib/idea-7364/bin"

Save and close the environment file. You’ll need to “source” it for your system to pick up the new directory in the PATH. You can verify your changes by echoing the variable as well:

source /etc/environment
echo $PATH

If you see the path to IntelliJ returned in the output, you’re all set.

Lastly, you may want to change the VM settings of IntelliJ. This depends entirely on your project size and other factors, so you’ll need to base these settings on your own need. The settings are in idea-xxx/bin/idea.vmoptions.

4) Get Started!

That’s it. Now you can run “idea.sh” from a terminal in any directory, and IntelliJ should launch…

idea.sh

If you run into problems, be sure to double-check the readme files in the installation directory.

Give Back

If this article proved useful to you, please drop us a comment and let us know. Or, if you find problems/alternate solutions along the way, please share them for the benefit of others. Thanks and happy coding!

27 06 2010

ubuntu 10.04 安装 Sun Java jdk

bigCat Posted in Linux - 0 Comment

ubuntu 10.04 去掉了sun-jdk 并推荐用openjdk

但是 Intellij IDEA 不推荐openjdk,所以偶还是要用sun-jdk


sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update

Synaptic Package Manager里就能搜到jdk了
sudo gedit /etc/environment

在 environment中修改如下信息:
PATH="/home/damao/Programs/idea/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/java-6-sun/bin"
JAVA_HOME="/usr/lib/jvm/java-6-sun"
CLASSPATH=".:/usr/lib/jvm/java-6-sun/lib"
JDK_HOME="/usr/lib/jvm/java-6-sun"

JDK_HOME这个是Intellij IDEA要用的,和JAVA无关

由 于ubuntu中有默认jdk还需要执行如下工作
执行
代码:
sudo update-alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_20/bin/java 300
sudo update-alternatives --install /usr/bin/javac javac /usr/java/jdk1.6.0_20/bin/javac 300

将我们安装的JDK加入java选单

sudo update-alternatives --config java

设置系统默认的JDK

java -version

Host: (miao) | Word: Press | Code: bigCat | Valid: HTML5