JVM cannot be found in the eclipse shortcut in Ubuntu

Source: Internet
Author: User

 

We installed the latest Ubuntu System Through vmware yesterday. The computer configuration is relatively high, so it runs very fast. Then we installed tomcat, Android, and other necessary development software. However, it took a lot of time for eclipse to record the solution.

 

1. Download JDK and eclipse.

You don't need to download it. Just go to the next version of Galileo on the eclipse official website. JDK is believed to be known to anyone who has downloaded windows Java. It is best to use version 1.5.0. I have never tried jdk1.6 compiling Android, so as to avoid detours and learn from previous experiences.

 

You don't have to say much about installing JDK. There are too many materials on the Internet. Several details are recorded here.

 

JDK path: basically, JDK can be installed anywhere. You can set java_home, classpath, and path to the correct path. My installation is as follows.

 

Export java_home =/usr/Java/jdk1.5.0 _ 22
Export classpath =.: $ java_home/lib/dt. jar: $ java_home/lib/tools. Jar
Export Path = $ path: $ java_home/bin

 

Since I am a beginner in Linux, I do not know how to set the Linux environment variables. From the results on the internet, I am in/etc/bash. bashrc and/etc/environment both add the above three lines.

 

 

2. Install eclipse.

From the Internet, eclipse can also be installed anywhere, and my installation is in/opt/eclipse. After the installation is complete, there will be a shortcut in applications-> program. This is the problem. Click this shortcut to report the following error.

 

A Java Runtime Environment (JRE) or Java Development Kit (JDK)
Must be available in order to run eclipse. No Java Virtual Machine
Was found after searching the following locations:
/Opt/Eclipse/JRE/bin/Java
Java in your current path

 

This is what I want to record in this blog, because it took me a lot of time to solve this simple problem.

From the final solution, it is because the desktop boot does not load the Three-line environment variables mentioned above. However, it can be started on the console through the command line.

 

The final solution is as follows:

 

In the Create File/usr/bin/eclipse, the content is as follows:

#! /Bin/sh
Export export illa_five_home =/usr/lib/Mozilla/
Export eclipse_home =/opt/eclipse

Export java_home =/usr/Java/jdk1.5.0 _ 22
Export classpath =.: $ java_home/lib/dt. jar: $ java_home/lib/tools. Jar
Export Path = $ path: $ java_home/bin

$ Eclipse_home/eclipse $ *

 

Then edit the eclipse shortcut

Change command to eclipse.

 

You can also write a bash script by yourself. The content in/userrun/eclipse. Sh is as follows:

 

#! /Bin/sh
Export gdk_native_windows = 1
Export eclipse_home =/opt/eclipse
Export java_home =/usr/Java/jdk1.5.0 _ 22
Export classpath =.: $ java_home/lib/dt. jar: $ java_home/lib/tools. Jar
Export Path = $ path: $ java_home/bin

$ Eclipse_home/eclipse $ *

 

Then, change the shortcut command to/userrun/eclipse. Sh, and enable the shortcut ase.

 

 

I found a lot of information on the Internet, which is fragmented. It is hard to understand what each person says. It's easy to look back. If the environment variables are set correctly, everything will be done.

 

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.