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 9240301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:09:55+00:00 2026-06-18T08:09:55+00:00

My environment is Windows 7 and JDK 1.7. I have not set the CLASSPATH

  • 0

My environment is Windows 7 and JDK 1.7.

I have not set the CLASSPATH environment variable; echo %CLASSPATH% outputs nothing.

Java compiler: C:\Program Files\Java\jdk1.7.0_10\bin
Java source: is in D:\tmpmulu\Tj.java

I run the command like below:

C:\>"C:\Program Files\Java\jdk1.7.0_10\bin\javac.exe" -cp d:\tmpmulu\ d:\tmpmulu\Tj.java

It works. The command set the classpath and compiled the file.

But when I change the command to use . instead of d:\tmpmulu\ as my classpath:

C:\>"C:\Program Files\Java\jdk1.7.0_10\bin\javac.exe" -cp . d:\tmpmulu\Tj.java

It’s also OK.

That confused me. The . means the current path, it should be c:\. How did it run successfully?

Another question is command like below:

C:\>"C:\Program Files\Java\jdk1.7.0_10\bin\javac.exe" -cp d:\tmpmulu\ Tj.java

As my thinking, the classpath is set to d:\tmpmulu\, it should find the Tj.java file. But the result is ‘file not found Tj.java’.

Can anyone tell me details?

  • 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-18T08:09:56+00:00Added an answer on June 18, 2026 at 8:09 am

    Well, presumably your code doesn’t rely on having anything in the classpath, basically. If it only uses classes from the JDK, that’s absolutely fine.

    Note that the classpath is only used to find class files – not source code. That explains both the lack of failure when your source path isn’t on the classpath, and then failure when you try to use the classpath to locate Tj.java.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have set JAVA_HOME = C:\Program Files\Java\jdk1.6.0_26 in user defined variables and system variables
Summary Java environment variables correctly set, as seen from echo-ing them. However, jars are
I have just installed JDK on Windows Vista. After that I set proper values
I have installed the JDK, to C:\jdk, the JAVA_HOME variable is set to C:\jdk\jdk,
Environment: Windows XP, SpringSource Tool Suite 2.3.2, Roo 1.0.2.Release, Java 1.6.0_10, tc Server 6.0
Consider me a novice to Windows environment and COM programming. I have to automate
we have the following environment: a Windows 2008 Server with Apache 2.2.14 and SVN
I am trying to set up a lein build environment on Windows 7 haven
I wanna setup Android Development Environment in Linux. I have done it in Windows
I'm running Windows Vista x64, and I have JDK 1.6.0_21 (x64 version, I believe)

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.