2

I have installed Java-ADT which is Android-SDK 64 bit version,installed jdk 64 bit version,installed jre 64 bit version,copied jre1.7.0_17 to eclipse folder and rename it to jre(after which I was able to run eclipse).

echo $PATH gives "/allSystemPaths:/pathToJDK:/PathToJDK/bin:/PathToJRE:/PathToJRE/bin:/PathToSDK/PlatformTools:/PathToSDK/tools"

echo $JAVA_HOME gives "/pathToJDK:/PathToJRE"

But when I run ANDROID SDK Manager still java not found error in android comes.I have searched a lot but not able to resolve it.

Tarun Chawla
  • 508
  • 4
  • 17
  • `JAVA_HOME` must only contain the path to the `JDK`, having it in the form where there are multiple entries (i.e. the two directories) is an error, and will cause it not to be found – Anya Shenanigans Mar 15 '13 at 09:31
  • Tried also but still problem persists. – Tarun Chawla Mar 15 '13 at 09:45
  • I've seen answers to similar questions [here](http://stackoverflow.com/a/9561108/27190) which suggest you might need JDK 1.6 in addition to 1.7. – martijno Mar 15 '13 at 10:19
  • when I run android sdk manager through terminal by typing android,then android sdk runs properly but throgh eclipse above error comes. – Tarun Chawla Mar 18 '13 at 12:21

1 Answers1

0

You can define a custom JVM in eclipse.ini, according to Eclipse documentation:

One of the most recommended options to use is to specify a specific JVM for Eclipse to run on. Doing this ensures that you are absolutely certain which JVM Eclipse will run in and insulates you from system changes that can alter the "default" JVM for your system. Many a user has been tripped up because they thought they knew what JVM would be used by default, but they thought wrong. eclipse.ini lets you be CERTAIN.

In order to do that, you need to know where is your Eclipse home or define it. In a console run:

$ echo $ECLIPSE_HOME

If you get a path skip next step. If you get nothing, that means you've to define one. On your home directory just edit .bashrc file and at the last file add:

ECLIPSE_HOME=$HOME/.eclipse

After this your ECLIPSE_HOME will be /home/YOUR_USER/.eclipse

Once you've a defined ECLIPSE_HOME, you need to create or edit a file named eclipse.ini inside of your ECLIPSE_HOME directory. Such file should have the following content:

 -vm
 /opt/sun-jdk-1.6.0.02/bin/java

Where /opt/sun-jdk-1.6.0.02/bin/java is the absolute path to java.

RobertoAllende
  • 8,744
  • 4
  • 30
  • 49