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

  • Home
  • SEARCH
  • 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 7742091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:11:42+00:00 2026-06-01T09:11:42+00:00

Ok, so. I ordered a book on Java (Sams teach yourself java in 21

  • 0

Ok, so. I ordered a book on Java (Sams teach yourself java in 21 days) a week ago, and it came in just yesterday. I am working on the first example code, and I keep getting this error when I try to compile the main code:

C:\VolcanoApplication.java:5: error: cannot find symbol

VolcanoRobot dante = new VolcanoRobot();

^

symbol: class VolcanoRobot

location: class VolcanoApplication

C:\VolcanoApplication.java:5: error: cannot find symbol

VolcanoRobot dante = new VolcanoRobot();

                     ^

symbol: class VolcanoRobot

location: class VolcanoApplication

And the main code Im trying to compile is:

public class VolcanoApplication
{
    public static void main(String[] arguments)
    {
        VolcanoRobot dante = new VolcanoRobot();
        dante.status = "exploring";
        dante.speed = 2;
        dante.temperature = 510;

        dante.showAttributes();
        System.out.println("Increasting speed to 3.");
        dante.speed = 3;
        dante.showAttributes();
        System.out.println("Changing temperature to 670.");
        dante.temperature = 670;
        dante.showAttributes();
        System.out.println("Checking the temperature.");
        dante.checkTemperature();
        dante.showAttributes();
    }
}

and the VolcanoRobot.java file:

public class VolcanoRobot
{
    String status;
    int speed;
    float temperature;

    void checkTemperature()
    {
        if(temperature > 660)
        {
            status = "returning home";
            speed = 5;
        }
    }

    void showAttributes()
    {
        System.out.println("Status: " + status);
        System.out.println("Speed: " + speed);
        System.out.println("Temperature: " + temperature);
    }
}

I am unable to get javac to run anywhere in command prompt (I’m running xp) so I navigate to where my javac.exe is (C:\Program Files\Java\jdk1.7.0_03\bin) and compile VolcanoApplication from there (VolcanoApplication is found on the root of C:)

When I just type Java anywhere I get the menu, but not javac. I declared the path and classpath variables, and yet it doesn’t work. any suggestions?

  • 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-01T09:11:43+00:00Added an answer on June 1, 2026 at 9:11 am

    Your best bet is to make javac work from any directory by going into the environment variables and changing your PATH so it includes C:\Program Files\jdk1.7.0_03\bin.

    Once you’ve done that, in a command prompt typing javac anywhere should work.

    The reason javac isn’t finding the VolcanoRobot.java file is that it’s not in the path that javac searches for source files. By default, that path includes the current directory, so if you cd to the directory containing VolcanoApplication.java and VolcanoRobot.java, then

    javac VolcanoRobot.java VolcanoApplication.java
    

    …should do it. If it doesn’t, add -cp .:

    javac -cp . VolcanoRobot.java VolcanoApplication.java
    

    You should then be able to run it via

    java VolcanoApplication
    

    …or

    java -cp . VolcanoApplication
    

    Update: Since my main workstation is Linux-based, I hadn’t done this under Windows 7 (used to do it all the time with Windows XP) and so I got to wondering whether there was something special about it. Doesn’t look like there is. I installed the JDK on my Windows 7 box and didn’t have any trouble using it. Here’s exactly what I did:

    1. Opened a command prompt and typed javac and pressed Enter, just to make sure I didn’t have one installed I didn’t remember. I got the usual “…is not recognized as an internal or external command” error.
    2. Downloaded the JDK installer from Oracle.
    3. Ran it, letting it install to its default location.
    4. Opened the Control Panel.
    5. Typed “environ” into the search box (because I’m lazy and don’t bother to keep track of where they’ve moved it to this week).
    6. Clicked the “Edit system environment variables” choice and clicked Yes on the admin permissions pop-up question. This opened a “System Properties” dialog with the “Advanced” tab open.
    7. Clicked the “Environment Variables…” button on that tab.
    8. In the “System variables” box at the bottom, scrolled down to Path.
    9. With that highlighted, clicked the “Edit…” button, which opened the “Edit System Variable” box.
    10. In Windows Explorer, navigated to the JDK’s bin directory, which was at C:\Program Files\Java\jdk1.7.0_03\bin.
    11. Clicked in the address bar, selected all, and copied that path to the clipboard.
    12. Back in the “Edit System Variable” box, I put the cursor at the end of the path, typed a semicolon (;) (note: not a colon, and with no spaces around it), and then pasted the path from the clipboard.
    13. Clicked the OK button on that box, the OK button on the “Environment Variables” box, and the OK button on the “System Properties” box.
    14. Opened a new commmand prompt.
    15. Typed javac and pressed Enter. I got the javac help listing.
    16. Created the two volcano source files and put them in a directory (in my case, C:\tmp\j).
    17. Changed into that directory.
    18. Typed:

       javac VolcanoRobot.java VolcanoApplication.java
      

      …and pressed Enter. I got no errors.

    19. Typed:

      java VolcanoApplication
      

      …and pressed Enter. It worked just fine, I got the output I’d expect from looking at the source files.

    So there’s no problem doing this on Windows 7. Perhaps what I did above will be helpful to you.

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

Sidebar

Related Questions

I ordered Programming Windows Fifth Edition a few days ago, and started working with
Ordered dictionaries are extremely useful structures, but unfortunately these are quite recent only working
I hi have just ordered a couple of beaglboards for experimenting. I know that
another ordered delivery problem. We have an orchestration which is bound to a send
Reduced Ordered Binary Decision Diagrams (ROBDD) are an efficient data structure for boolean functions
I have multiple ordered lists. Unfortunately, the order of the items isn't a simple
Ok so I've ordered Applying Domain-Driven Design and Patterns: Using .Net , but while
Python has an ordered dictionary . What about an ordered set?
I m having a ordered list having the structure <ol> <li> </li> <li> </li>
I have an ordered list in HTML. I would like to add styling only

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.