• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Eclipse IDE and JDK

 
Rahul Ba
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

How to find which JDK is using by Eclipse? In in the Eclipse IDE inside Installed JRE i can see value as JRE 6, but not able to find JDK. In my system Oracle is installed too. It has javac.exe..My question how to make sure which JDK it using?
 
mike ryan
Ranch Hand
Posts: 210
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

If you click window in the top menu, then preferences , then java / installed jre's.It tells you in that panel the current JDK version you are running.

Mike
 
Rahul Ba
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Mike, this is my question only. I did not see any JDK there. Only installed thing related to Java is JVM and also Oracle is installed.Oracle is having it's own JDK, but I am not sure which JDK is used by Eclipse ?

 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eclipse by default will use the first java executable on the PATH. So you could enter the following command on the command line:

java -version

You can also add a -vm entry into eclipse.ini to force it to use a specific JVM.
 
Nicole Miller
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I'm also having problems getting eclipse to work. I installed it and tried to open it, but this message appeared:

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.
C:\Users\Me\Downloads\eclipse\jre\bin\javaw.exe
javaw.exe in your current PATH

So, I went online and installed a JDK, the right one for my computer, and I have tried using your instructions to set my path, but that same message keeps appearing. What can I do to make this work? I need Eclipse for my Compsci class assignment.

Thank you so much.
 
mike ryan
Ranch Hand
Posts: 210
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nicole,

Take a look at this link i think it will help you..

more specifically this one!!


Mike
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try opening a command prompt and entering:

java -version

and see what it says.

Also, try adding the -vm entry to your eclipse.ini file as described in this post:
http://www.coderanch.com/t/488574/vc/Eclipse-running-JRE-but-JDK#2472984
 
Nicole Miller
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I still can't get Eclipse to even open. I know I have both the current JRE and JDK installed, Eclipse just cannot find them.

Peter, when I open a command prompt and enter java -version, it says 'java is not recongnized as an internal or external command, operable program or batch file.

I have no idea how to add the -vm entry to my eclipse.ini.file. I am installing Eclipse in order to start work on my first ever computer class. I am very, very lost when it comes to technical terms.

I believe specifying the JVM would fix my problem, but I have no idea how to do this.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are getting the "java is not recognized as an internal or external command" then you did not install Java correctly. Try this:

a) Got to http://www.oracle.com/technetwork/java/javase/downloads/index.html, scroll down to the "Java SE 6 Update 27" section and click on the JDK Download button in that section.

b) On the downloads page, click the "jdk-6u27-windows-i586.exe" link (unless you downloaded the 64-bit version of Eclipse, in which case you should choose " jdk-6u27-windows-x64.exe")

c) Once the exe file is on your PC, run it and follow the installation instructions. (By the way, by default it will want to install in C:\Program Files; I usually change that to install at c:\apps\java. Having spaces in paths sometimes causes problems for Java apps.)

After that is done, try running the "java -version" command again. You should get some output identifying the version. Then try running eclipse again.

If you still get the "java is not recognized as an internal or external command" error after doing the above steps, at a command prompt enter "set path" and post the results (most likely your PATH is messed up)
 
Nicole Miller
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I still get the 'java is not recognized as an internal or external command' error. When I enter 'set path' I get:
Path=C:\Users\Nicole\Downloads\bin:
PATHEXT=.COM;.EXE;.BAT;/CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is your problem - your PATH has been wiped out. Based on the setting, I suspect that you changed your PATH. To fix this, go to Computer | Properties | Advanced System Settings and click on the Environment Variables button.

There are two scrolling boxes, one labeled "User variables for ..." and the other labelled "System Variables". Under the "User variables for ..." box, click the New button and enter:

Variable name: PATH
Variable value: C:\Users\Nicole\Downloads\bin

That will move your current PATH setting to the user's area.

Then under System Variables, find the PATH entry, select it and click Edit. Change it as follows:

Variable name: PATH
Variable value: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\

Then click OK to close all of the dialogs. That should get the PATH back to its original setting.

Open a new Command Prompt window and try the "java -version" again (and follow the instructions from my previous post).
 
Nicole Miller
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works! Thank you so much. I was getting really worried because I have an assignment to complete for my Compsci class.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm glad you are up and running. Good luck in your class!
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Christopher Wong,
Your post was moved to a new topic. Please do not resurrect old topics to ask a new/different question, instead create a new topic. Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic