• Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting up an environment variable  RSS feed

 
Jordan King
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to install sdk but the installer is not locating it(even though it is exactly where the installer is searching). Can anyone tell me exactly how to set up an environment variable JAVA_HOME to point to it?
 
Ron McLeod
Bartender
Posts: 1603
232
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jordan King wrote:Can anyone tell me exactly how to set up an environment variable JAVA_HOME to point to it?

For which operating system and version?
 
Jordan King
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
windows 10 64bit
 
Ron McLeod
Bartender
Posts: 1603
232
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
  - Right-click on the start icon, then select System.
  - Select Advanced system settings to open the System Properties window.
  - At the bottom, click on Environment Variables ...
  - In the System variables section, look for JAVA_HOME variable.
  - If it is already defined, double-click to edit the value.
  - If it is not defined, click on New ... to create and set the variable.

 
Knute Snortum
Sheriff
Posts: 4288
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Go to the Windows Search bar (lower left). Type in "environment". One of the choices will be "Set system environment variables". Click the environment variables button. Add or Edit JAVA_HOME, probably to your system variables. The variable should be set to "C:\Program Files\Java\jdk1.8.0_74" or something like that, depending where the JDK is installed.
 
Jordan King
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have now tried setting JAVA_HOME as a user variable and a system variable in C:Program Files\Java\etc.

and under system32
it is still saying failed to find java version
which I know there is a java file in both locations
 
Ron McLeod
Bartender
Posts: 1603
232
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jordan King wrote:I have now tried setting JAVA_HOME as a user variable and a system variable in C:Program Files\Java\etc. ...

What exactly did you set the JAVA_HOME variable to?

Jordan King wrote:I am trying to install sdk but the installer is not locating it ...?

Which SDK are you trying to install? Android SDK?
 
Paul Clapham
Sheriff
Posts: 22844
43
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jordan King wrote:I have now tried setting JAVA_HOME as a user variable and a system variable in C:Program Files\Java\etc.


you should use an absolute path there, like this: C:\Program Files\Java\etc. Notice how there's a backslash after the drive name. If you don't do that then it's a relative path, relative to your current working directory in that drive. Or some process's current working directory at any rate, but you can't rely on that.
 
Jordan King
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried that as well. nothing seems to be working.
 
Paul Clapham
Sheriff
Posts: 22844
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's go back to the beginning...

Jordan King wrote:I am trying to install sdk but the installer is not locating it(even though it is exactly where the installer is searching). Can anyone tell me exactly how to set up an environment variable JAVA_HOME to point to it?


What's the "it" which the installer isn't locating? I'm not sure why the installer should be searching for the SDK, since the whole purpose of the installer is to install the SDK. So perhaps this is the installer for something else?

And also: you shouldn't have to set up any environment variables to install and use the SDK these days. Unless the "it" you're referring to is something other than the SDK, that is. I have to say your question seems confusing to me.
 
Jordan King
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the sdk Tools Setup installer cannot find Java SE Development Kit
 
Jordan King
Ranch Hand
Posts: 33
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
aha! So I was downloading version 7 instead of 8.
problem solved.
 
Jordan King
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if I have android studio as my sdk, which file would I want to select as the path to my android sdk.
 
Jordan King
Ranch Hand
Posts: 33
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nevermind I just looked it up in android studio.
 
zlatan rahim
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Select Computer from the Start menu
Choose System Properties from the context menu
Click Advanced system settings > Advanced tab
Click on Environment Variables, under System Variables, find PATH, and click on it.
In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
Reopen Command prompt window, and run your java code.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!