komeil sh
komeil sh

Reputation: 111

eclipse isn't working after reinstalling jre and jdk

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?

Upvotes: 0

Views: 1706

Answers (5)

chimbu
chimbu

Reputation: 114

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

Upvotes: 0

Crickcoder
Crickcoder

Reputation: 2155

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

Upvotes: 0

ra bes
ra bes

Reputation: 163

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 :)

Upvotes: 2

Xiabili
Xiabili

Reputation: 486

you need check your java configuration

look at here

Upvotes: 0

Juned Ahsan
Juned Ahsan

Reputation: 68715

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.

Upvotes: 2

Related Questions