Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8383895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:16:54+00:00 2026-06-09T17:16:54+00:00

I installed JDK on my PC running windows XP, the default directory of JDK

  • 0

I installed JDK on my PC running windows XP, the default directory of JDK is :

C:\Program Files\Java\jdk1.7.0_05\bin

I’m following the tutorial to do a sample
My source file named HelloWorld is in another directory : E:\NotePad\Code

As the tutorial says : “To compile your source file, change your current directory to the directory where your file is located” , so I change my Command’s current directory to E:\NotePad\Code , but here comes the problem which is saying ‘javac’ is not recognized as an internal or external command

Well, the tutorial has a solution to this problem, it seems that I should change Command Line’s current directory to where the JDK is installed which is : C:\Program Files\Java\jdk1.7.0_05\bin

After I finish it, I try this commond : javac HelloWorld.java to compile the file, but it says

javac : cannot find file : HelloWorld.java

It means that the HelloWorld.java file in E:\NotePad\Code can’t be compiled by the JDK which is installed in C:\Program Files\Java\jdk1.7.0_05\bin
I try putting the HelloWorld.java file in C:\Program Files\Java\jdk1.7.0_05\bin , it works fine

So the question is : How can I Compile&Run a file with the JDK installed in a different directory ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T17:16:56+00:00Added an answer on June 9, 2026 at 5:16 pm

    You will either need C:\Program Files\Java\jdk1.7.0_05\bin on your PATH, or reference the compiler directly using

    C:\Program Files\Java\jdk1.7.0_05\bin\javac
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running Ubuntu 11.10 and have installed jdk-6u30-linux-i586.bin and have a directory /usr/local/jdk1.6.0_30
I have just installed Java JDK 6u33 in Windows XP. Even though I didn't
I am currently running JDK 6 on Windows 7 and have installed the Unlimited
I had java jdk 1.6 installed, and today installed jdk 1.7 becaused needed to
I installed/uninstalled java jre/jdk now many times and finally installed the older version 1.6.0_17
The short version of my issue at hand, Windows 7 Professional x64 Java JDK
I am learning Java from scratch. I installed the JDK, and I got the
On a Mac with JDK and all Groovy necessities installed, how can Groovy files
by default ubuntu comes with openjdk. I installed jdk from sun, and removed openjdk,
On my work computer, I have Windows 7 x64 with JDK 1.7 installed. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.