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 11 of 11

Thread: JRE install - issues

  1. #1
    Junior Member
    Join Date
    Sep 2014
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default JRE install - issues

    I am new to programming, installed jre-7u67-windows-i586 (have Win Vista), tried java tutorial from Oracle and got stuck on first exercise - created x.java file and tried to run it in CMD: javac x.java and got message 'javac' is not recognized as an internal or external command, operable program or batch file. What am I doing wrong/missing?
    thanks


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: JRE install - issues

    'javac' is not recognized as an internal or external command, operable program or batch file.
    The OS can not find the javac.exe file. The path to the bin folder that the javac.exe file is in must be in the PATH environment variable.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: JRE install - issues

    Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for new members.

    There are step-by-step instructions that guide you through how to configure your OS environment for Java development, probably near where you downloaded the JRE. However, the JRE does not include javac, so you need to download and install the Java SDK or JDK. Again, the instructions how to configure your system for its use should be near the download point.

    Good luck and come back if you need help.

  4. #4
    Junior Member
    Join Date
    Sep 2014
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: JRE install - issues

    Quote Originally Posted by Norm View Post
    The OS can not find the javac.exe file. The path to the bin folder that the javac.exe file is in must be in the PATH environment variable.
    Thanks Norm! I couldn't find javac.exe in C:/Program Files/Java/jre7/bin (that's my path), I see javacpl Application - is it the same? I entered path 'C:/Program Files/Java/jre7/bin ' everywhere I can think off, with no luck: 1. In user variables I found 'path' with '%CommonProgramFiles%\Microsoft Shared\Windows Live' and appended it with my path as '%CommonProgramFiles%\Microsoft Shared\Windows Live;C:\Program Files\Java\jre7\bin;' 2. I did the same for System variables. 3. I created new variable in System variables - JAVA_HOME and put the same path in it. Now, even before all that when I run 'java -version' in CMD it returns version number, but still, javac command is not recognized.
    Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
    Picked up _JAVA_OPTIONS: -Xrunjvmhook -Xbootclasspath/a:C:\PROGRA~1\HP\QUICKT~1\bin\JAVA_S~1\classes;C:\ PROGRA~1\HP\QUICKT~1\bin\JAVA_S~1\classes\jasmine. jar
    java version "1.7.0_67"
    Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
    Java HotSpot(TM) Client VM (build 24.65-b04, mixed mode)

  5. #5
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: JRE install - issues

    I couldn't find javac.exe in
    Sorry, I missed the JRE part. See Greg's post about what package the javac.exe file is part of. It's in the JDK not in the JRE.
    If you don't understand my answer, don't ignore it, ask a question.

  6. #6
    Junior Member
    Join Date
    Sep 2014
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: JRE install - issues

    Quote Originally Posted by Norm View Post
    Sorry, I missed the JRE part. See Greg's post about what package the javac.exe file is part of. It's in the JDK not in the JRE.
    Thanks everyone!
    Looks like JDK8 is not compatible with Vista (was getting 1603 error), I uninstalled everything and installed JDK7, updated Environment variables and it works fine now!

  7. #7
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: JRE install - issues

    Glad you figured it out.

  8. #8
    Junior Member
    Join Date
    Sep 2014
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: JRE install - issues

    Quote Originally Posted by GregBrannon View Post
    Glad you figured it out.
    another question - I am going through Java Tutorial, created MyFirstJavaProgram.java in Notepad, in CMD went to file location, typed 'javac MyFirstJavaProgram.java' and got ''file not found'. Also it gave me a hint - javac <options> <source files>. am I missing <options>, is it mandatory, or could it be anything else? Thanks

  9. #9
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: JRE install - issues

    Was the source file in the current directory when you used the javac command?
    Use the dir command to list the files in the current directory to see what's there.
    If you don't understand my answer, don't ignore it, ask a question.

  10. #10
    Junior Member
    Join Date
    Sep 2014
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: JRE install - issues

    thanks Norm - it turns out file was saved as .txt not .java

  11. #11
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: JRE install - issues

    If you are using windows explorer you MUST turn off the feature that hides a file's extension.
    If you don't understand my answer, don't ignore it, ask a question.

  12. The Following User Says Thank You to Norm For This Useful Post:

    GregBrannon (September 30th, 2014)

Similar Threads

  1. Install Java plugin for IE without manual update or install
    By madhucm in forum What's Wrong With My Code?
    Replies: 0
    Last Post: September 21st, 2014, 09:20 AM
  2. Replies: 16
    Last Post: March 7th, 2014, 02:22 AM
  3. Replies: 3
    Last Post: May 16th, 2013, 09:17 AM
  4. Issues with my ordering program - if statement issues?
    By Shenaniganizer in forum What's Wrong With My Code?
    Replies: 5
    Last Post: October 31st, 2012, 10:17 PM
  5. Maven Issues - mvn install
    By Paolo Futre in forum Java Theory & Questions
    Replies: 5
    Last Post: August 26th, 2009, 05:07 AM