0

I used eclipse for android development. today I reinstalled the jre and jdk for a wrong reason, after that my eclipse doesn't work and says: A java runtime environment (jre) or java development kit (jdk) is needed in order to run eclipse... but i know that they are installed on my computer and when i use a new eclipse it doesn't have any problems for starting but when i changed the workspace to one which i used with my ex-eclipse, a lot of the codes were underlined red showing they have errors. it seems that the current sdk is not same with the older eclipse. this version is older. what should i do? is there any way to bring my ex-eclipse working again?

komeil sh
  • 111
  • 3
  • 13
  • First rule of programming: read the error message. Eclipse has a "Problems" view, which lists all the errors. Read them. – JB Nizet Aug 24 '13 at 09:24
  • 1
    might be the same: http://stackoverflow.com/questions/4419983/eclipse-cant-find-the-jdk-or-jre – Katona Aug 24 '13 at 09:27

5 Answers5

2

i changed the workspace to one which i used with my ex-eclipse, a lot of the codes were underlined red showing they have errors.

This may be because in your project settings, you have the old jre associated, which may no longer be existing. There are multiple jre libs that are used in any java project.

So you may have to change the old jre settings with the newly installed jre. Here is how you can do it:

In eclise go to menu->window->preferences->java->installed JREs-> remove the old unavailable jre and add the new one.

Juned Ahsan
  • 67,789
  • 12
  • 98
  • 136
2

Maybe you have to check eclipse.ini file and remove -vm

And make sure that the java environment setting in eclipse points to the correct directory.

Hope this help :)

ra bes
  • 143
  • 1
  • 1
  • 5
0

you need check your java configuration

look at here

Xiabili
  • 486
  • 5
  • 20
0

Set the new jdk in your classpath as well as eclipse preferences

Crickcoder
  • 2,135
  • 4
  • 22
  • 36
0

Set the Environment variables using

Right click on mycomputer -> properties -> system properties -> Advanced system settings -> Advanced tab -> Environment Variables

And also update the eclipse.ini with

-vm 
C:\Program Files (x86)\Java\JDk\jre\bin\javaw.exe
chimbu
  • 104
  • 1
  • 11