Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 10 of 10

Thread: JDK and JRE is not recognized on separate account.

  1. #1
    Junior Member
    Join Date
    Apr 2018
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default JDK and JRE is not recognized on separate account.

    I recently make a new windows user account for the sole purpose of building android apps (to keep everything organized). The problem is, when I installed the JDK and JRe and set the paths in the environmental variables, and test if they were installed by doing 'javac' on the command prompt, it works on my administrator account, but it is not recognized on the user account I just made when I put 'javac' on the command prompt in the new user account. what is going on?

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: JDK and JRE is not recognized on separate account.

    What kind of OS are you working with?
    Are there separate Environment variables for each user?

    On Windows What is shown in the command prompt window when you enter SET as a command?
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Apr 2018
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: JDK and JRE is not recognized on separate account.

    Quote Originally Posted by Norm View Post
    What kind of OS are you working with?
    Windows 7

    Quote Originally Posted by Norm View Post
    Are there separate Environment variables for each user?
    My administrator account and android user account are using the same environmental variables. But when I put 'javac' on the command prompt of my administrator account, it says a bunch of stuff, but when I put 'javac' on my android user account, it says it is not recognized.

    Quote Originally Posted by Norm View Post
    On Windows What is shown in the command prompt window when you enter SET as a command?
    A bunch of junk I can't understand
    VArNKMe.jpg

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: JDK and JRE is not recognized on separate account.

    To copy the contents of the command prompt window:
    Click on Icon in upper left corner
    Select Edit
    Select 'Select All' - The selection will show
    Click in upper left again
    Select Edit and click 'Copy'

    Paste here.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Apr 2018
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: JDK and JRE is not recognized on separate account.

    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\Users\AndroidWorkshop>SET
    ALLUSERSPROFILE=C:\ProgramData
    APPDATA=C:\Users\AndroidWorkshop\AppData\Roaming
    asl.log=Destination=file
    CLASS=C:\Program Files\Java\jdk-10.0.1\bin;C:\Program Files\Java\jre-10.0.1\bin
    CommonProgramFiles=C:\Program Files\Common Files
    CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
    CommonProgramW6432=C:\Program Files\Common Files
    COMPUTERNAME=NOYSDESKTOP
    ComSpec=C:\Windows\system32\cmd.exe
    FP_NO_HOST_CHECK=NO
    HOMEDRIVE=C:
    HOMEPATH=\Users\AndroidWorkshop
    LOCALAPPDATA=C:\Users\AndroidWorkshop\AppData\Loca l
    LOGONSERVER=\\NOYSDESKTOP
    NUMBER_OF_PROCESSORS=4
    OS=Windows_NT
    Path=C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system3
    2;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\S ystem32\WindowsPowerShell\v1.0
    \;C:\Program Files (x86)\AMD\ATI.ACE\Core-Static;C:\Program Files (x86)\NVIDIA C
    orporation\PhysX\Common
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WS F;.WSH;.MSC
    PROCESSOR_ARCHITECTURE=AMD64
    PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 94 Stepping 3, GenuineIntel
    PROCESSOR_LEVEL=6
    PROCESSOR_REVISION=5e03
    ProgramData=C:\ProgramData
    ProgramFiles=C:\Program Files
    ProgramFiles(x86)=C:\Program Files (x86)
    ProgramW6432=C:\Program Files
    PROMPT=$P$G
    PSModulePath=C:\Windows\system32\WindowsPowerShell \v1.0\Modules\
    PUBLIC=C:\Users\Public
    QMLSCENE_DEVICE=softwarecontext
    QSG_RENDER_LOOP=basic
    QT_SCALE_FACTOR=1
    SESSIONNAME=Console
    SystemDrive=C:
    SystemRoot=C:\Windows
    TEMP=C:\Users\ANDROI~1\AppData\Local\Temp
    TMP=C:\Users\ANDROI~1\AppData\Local\Temp
    USERDOMAIN=NOYSDESKTOP
    USERNAME=AndroidWorkshop
    USERPROFILE=C:\Users\AndroidWorkshop
    windir=C:\Windows
    windows_tracing_flags=3
    windows_tracing_logfile=C:\BVTBin\Tests\installpac kage\csilogfile.log

    C:\Users\AndroidWorkshop>

    --- Update ---

    BTW, AndroidWorkshop is the new user account I created for android app development (to keep everything organize. I don't want to do everything on my main administrator account.)

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: JDK and JRE is not recognized on separate account.

    'javac' on my android user account, it says it is not recognized.
    That message says that the path to the javac.exe file is not on the OS's PATH environment variable.
    I see a path to the JDK's bin folder in a variable named CLASS but not in the PATH variable.
    CLASS=C:\Program Files\Java\jdk-10.0.1\bin;C:\Program Files\Java\jre-10.0.1\bin
    What is the CLASS variable for? What program uses that?
    The OS uses PATH to find exe files. Make sure the path to the JDK's bin folder is in the PATH variable.
    If you don't understand my answer, don't ignore it, ask a question.

  7. #7
    Junior Member
    Join Date
    Apr 2018
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: JDK and JRE is not recognized on separate account.

    Quote Originally Posted by Norm View Post
    That message says that the path to the javac.exe file is not on the OS's PATH environment variable.
    I see a path to the JDK's bin folder in a variable named CLASS but not in the PATH variable.
    Strange, I put the JDK link from my program files and pasted it into both the PATH and CLASS variable



    Quote Originally Posted by Norm View Post
    What is the CLASS variable for? What program uses that?
    The OS uses PATH to find exe files. Make sure the path to the JDK's bin folder is in the PATH variable.
    It was from a long time ago (I don't exactly remember when), but it was when I couldn't run a Java code on eclipse that I went on some YouTube video and some guy said to make a class variable. It was basically copying everything from the PATH variable and pasting it into the CLASS variable (again it was a long time ago). But both the PATH and CLASS variables are the same:

    C:\Program Files\Java\jdk-10.0.1\bin;C:\Program Files\Java\jre-10.0.1\bin;C:\Users\AndroidWorkshop\AppData\Local\ Android\Sdk\tools;C:\Users\AndroidWorkshop\AppData \Local\Android/Sdk\platform-tools

    So do I just delete the CLASS variable?

  8. #8
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: JDK and JRE is not recognized on separate account.

    So do I just delete the CLASS variable?
    You could get rid of it and see if anything breaks.
    If you don't understand my answer, don't ignore it, ask a question.

  9. #9
    Junior Member
    Join Date
    Apr 2018
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: JDK and JRE is not recognized on separate account.

    But when I had the PATH and CLASS variables, both ran fine on my administrator account. But on the AndroidWorkshop account, it did not recognize, or could not find the JDK or JRE

  10. #10
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: JDK and JRE is not recognized on separate account.

    I don't know what the CLASS variable is for. Having it probably will not hurt anything.
    But it is needed for the path to the javac.exe folder to be on the PATH variable so the OS can find the javac.exe program.

    on the AndroidWorkshop account, it did not recognize, or could not find the JDK
    I assume you are referring to the javac.exe program.
    That is because the path to the javac.exe file was not on the PATH variable. What you posted shows the path is missing from the PATH variable.

    What is shown for the SET command on the Administrator's account?
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. set up java (jdk/jre, path) in windows 7
    By amhgar in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 26th, 2017, 08:23 AM
  2. [SOLVED] JDK SE, JRE and Eclipse not working
    By NorrinGalan in forum Java IDEs
    Replies: 3
    Last Post: February 7th, 2014, 05:21 AM
  3. No JRE or JDK in JVM
    By Jobrien15 in forum Computer Support
    Replies: 7
    Last Post: October 1st, 2013, 07:40 PM
  4. JRE and JDK Questions
    By beer-in-box in forum Computer Support
    Replies: 11
    Last Post: September 16th, 2011, 05:37 PM
  5. Replies: 2
    Last Post: January 8th, 2010, 08:22 AM