Results 1 to 12 of 12
  1. #1
    mallik.koneru is offline Member
    Join Date
    Mar 2010
    Posts
    5
    Rep Power
    0

    Default able to compile but unable to run. can any one tell me wats the mistake?

    class VolcanoRobot5 {
    String status;
    int speed;
    float temperature;

    VolcanoRobot5(String inStatus, int inSpeed, float inTemperature) {
    status = inStatus;
    speed = inSpeed;
    temperature = inTemperature;
    }

    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);
    }

    public static void main(String[] arguments) {
    VolcanoRobot5 dante = new VolcanoRobot5("exploring", 2, 510);

    dante.showAttributes();
    System.out.println("Increasing 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();
    }
    }

  2. #2
    dswastik is offline Senior Member
    Join Date
    Dec 2008
    Location
    Kolkata
    Posts
    283
    Rep Power
    8

    Default

    Not able to runs means?? Whats the issue?? And please code tags to show your code.
    Swastik

  3. #3
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    877
    Rep Power
    8

    Default

    code is ok and runnable right.Any path related exceptions u are getting?
    Ramya:cool:

  4. #4
    mallik.koneru is offline Member
    Join Date
    Mar 2010
    Posts
    5
    Rep Power
    0

    Default

    when i try to run in cmd prompt, it says
    exception in thread main java.lang.noclassdeffound

  5. #5
    m00nchile is offline Senior Member
    Join Date
    Feb 2010
    Location
    Ljubljana, Slovenia
    Posts
    470
    Rep Power
    7

    Default

    What exactely are you typing into cmd? If you're typing in:
    Java Code:
    java VolcanoRobot5.class
    just omit .class.
    Ever seen a dog chase its tail? Now that's an infinite loop.

  6. #6
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    10

    Default

    Post the exact command that you are typing and the exact exception that you get.

  7. #7
    mallik.koneru is offline Member
    Join Date
    Mar 2010
    Posts
    5
    Rep Power
    0

    Default

    to compile javac volcanorobot5.java

    to run java volcanorobot5.java

  8. #8
    m00nchile is offline Senior Member
    Join Date
    Feb 2010
    Location
    Ljubljana, Slovenia
    Posts
    470
    Rep Power
    7

    Default

    Java is case sensitive. And when you run a java app, just type in the class name that has the main method, without any extensions.
    Ever seen a dog chase its tail? Now that's an infinite loop.

  9. #9
    dswastik is offline Senior Member
    Join Date
    Dec 2008
    Location
    Kolkata
    Posts
    283
    Rep Power
    8

    Default

    should be java VolcanoRobot5
    Swastik

  10. #10
    mallik.koneru is offline Member
    Join Date
    Mar 2010
    Posts
    5
    Rep Power
    0

    Default

    oh thanq very much, i was using the extension, now its fine, thanq moonchile. bye.

  11. #11
    mallik.koneru is offline Member
    Join Date
    Mar 2010
    Posts
    5
    Rep Power
    0

    Default

    s i got it swastik

  12. #12
    m00nchile is offline Senior Member
    Join Date
    Feb 2010
    Location
    Ljubljana, Slovenia
    Posts
    470
    Rep Power
    7

    Default

    Quote Originally Posted by mallik.koneru View Post
    s i got it swastik
    Oh my my, what a typo :D
    Ever seen a dog chase its tail? Now that's an infinite loop.

Similar Threads

  1. Replies: 5
    Last Post: 11-20-2011, 10:22 PM
  2. org.apache.jasper.JasperException: Unable to compile class for JSP
    By satya kishore in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 04-13-2010, 02:40 PM
  3. Wats up, Java people
    By littlebrat in forum Introductions
    Replies: 0
    Last Post: 02-12-2009, 06:48 PM
  4. JasperException: Unable to compile
    By Aerinai in forum Java Servlet
    Replies: 0
    Last Post: 06-17-2008, 06:16 PM
  5. Unable to compile
    By gapper in forum New To Java
    Replies: 2
    Last Post: 01-14-2008, 05:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •