Newbie having trouble compling and running code

Ok I bought a beginning Java book to learn. I loaded the JDK into a file c:\java\jdk1.5.0_06. Set up a folder called code at c:\java\code. Set my paths for both PATH and CLASSPATH under both user variable and system variable to c:\java\jdk1.5.0_06\bin. During compiling I had a problem with the error "'javac' is not recognized as an internal or exter..." I got that worked out. I have my party.class file in the code directory. When I try to run it using "c:\java\code> java party" I get this error. "Exception in thread "main" java.lang.NoClassDefFoundError: party. " I ran a dir and I can see party.class. I get the same results when I run the HelloWorldApp.class also.
One thing I did try was "set CLASSPATH = "
Then I could run the HelloWorldApp.class ., but the Party.class still will not run. It gives this error "Exception in thread "main" java.lang.NoSuchMethodError: main"
I have read through a bunch of forums online but have not find anything to rmemdy this.
Here is the code
Party.java
import java.awt.*;
import java.awt.event.*;
class party {
  public void buildInvite(){
    Frame f = new Frame();
    Label l = new Label ("Party at Tim's");
    Button b = new Button ("You Bet");
    Button c = new Button ("Shoot me");
    Panel p = new Panel();
    p.add(l);
    } //more code here...
} HelloWorldApp.java
* The HelloWorldApp class implements an application that
* simply displays "Hello World!" to the standard output.
class HelloWorldApp {
    public static void main(String[] args) {
        //Display "Hello World!"
        System.out.println("Hello World!");
}Thanks for your help

OK I think I figured out the main method thing. But
now I have gone back to getting the "Exception in
thread "main" java.lang.NoClassDefFoundError: party.
" error. Everything I have read said this was cause
by looking int he wrong dir. But I can run dir and
see party.class
import java.awt.*;
import java.awt.event.*;
class party {
     public void buildInvite(){
          Frame f = new Frame();
          Label l = new Label ("Party at Tim's");
          Button b = new Button ("You Bet");
          Button c = new Button ("Shoot me");
          Panel p = new Panel();
          p.add(l);
     } //more code here...
     public static void main(String[] args) {
              // code here
} Does this one work?

Similar Messages

  • I am having trouble installing and running the latest version (11.1.4) of itunes for windows

    I have downloaded itunes 11.1.4 on my windows vista pc and i get a nicrosoft visual c++ runtime error message 6034 and can't get any further.  Does anybody know how to fix this?

    Click here and follow the instructions. You may need to completely remove and reinstall iTunes and all related components, or run the process multiple times; this won't normally affect its library, but that should be backed up anyway.
    (99322)

  • Having trouble with my PHP code. Appers to get stuck on a white page.

    HI all,
    I have just began having trouble with my PHP code. Was working before and haven't made any changes to the code since last time it worked.
    What happens is after the form is submitted it goes to a white page (no text just all white page) and in the address bar it has the path for my php page. what supposed to happen is either it goes to a success page or a error page.
    I've had a problem where the info entered is correct but was directed to the error page. i managed to fix that issue but i am puzzled what is happening to my php page now.
    Mind you that i didn't write this code i just took over the responsiblities of this website and i am hopping that its a quick fix.
    I appreciate any help you could give me. Thank you.
    CODE:
    <?php
       $to = '[email protected]';
          $from = '[email protected]';
            //Make sure we have some info posted from the form...
            if (isset($HTTP_POST_VARS)){
                //Clear the body of the message to be sent
                $body = '';
                //go through all POSTed variables sent
                while (list($key, $value) = each($HTTP_POST_VARS)){
        if($key <> "Submit" && $key <> "submit") {
         $body .= $key . ' = ' . $value . "\r\n"; 
                //Now building mail headers.....
                $headers = "From: ".$from."\r\n";
                //Mail message
                $success = mail($to, "Email Club" . date("m/d/Y"), $body, $headers);
       // CURL stuff.....
       $ch = curl_init();
       curl_setopt($ch, CURLOPT_FAILONERROR, 1);
       curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
       curl_setopt($ch, CURLOPT_TIMEOUT, 4); //times out after 4s
       curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
                 if ($success){
        //readfile('http://www.lvpaiutegolf.com/thankyou.html');
        curl_setopt($ch, CURLOPT_URL,"http://www.lvpaiutegolf.com/thankyou.html");
        header("Location:http://www.lvpaiutegolf.com/thankyou.html");
                else{
                 // readfile('http://www.lvpaiutegolf.com/error.html');
         curl_setopt($ch, CURLOPT_URL,"http://www.lvpaiutegolf.com/error.html");
         header("Location:http://www.lvpaiutegolf.com/error.html");
       // Output
       //$result=curl_exec ($ch);
       //curl_close ($ch);
       //echo $result'";
    ?>

    Insert the install disk and boot from it. Use disk utitlity to repair your drive and check for errors (report any errors back here) then reinstall the os. This should not erase your data.

  • Having Trouble Copy and Pasteing Local Variable in LabVIEW 2010

    I am Having Trouble Copy and Pasteing Local Variable in LabVIEW 2010 in s subVI.
    I have a VI that has a Local Variable called "Node Addr". I can select it OK, and it appears to Copy OK, But when I go to paste it, nothing appears. It doesn't matter if I use Cntrl-C Cntrl-V or the Copy and Paste from the Edit menu, I get the same results. I tried many times and got the same results. I made sure that I had click a paste location. I can insert the Local Variable if I use the Data Communication panel.
    On one of the Paste, I got an error in the error list that said that a Local Variable was not connected to anything. When I clicked on the error, it took me to an insible item in the lower right corner of the block diagram that had nothing but a select box around it. I couldn't select the invisible item, but I could delete it.
    Why does the copy and paste of this local variable not work?
    Why does the paste cause the insertion of an invisible item?

    dbaechtel wrote:
     My VI is fairly complicated. In several places in the VI, I am either reading or writing to this variable which is an numeric Indicator on the Front Panel. Using local variables seems to be the best way to handle this situation rather that using wiring all over the VI. Since the VI is mainly a State Machine and there are only 2 Writes to the local variable, I am not afraid of race conditions in this case.  NO!! While you may think that using Locals is your solution to wiring, it is not!  The fact that you are writing and reading, most likely from several places, will most definitely contribute to a race condition.  Depending on your implemetation, you should ALWAYS use wires.  The wires are the variable.  If you are using a loop (While, For), then using shift registers are appropriate means for routing values so that they are used by other sections of the code, later.  One thing you must respect with LabVIEW is the dataflow.  That's where Locals often fail.
    I am not copying the Local Variable from one VI to another.
    I am not copying the Local Variable from one VI to another.
    The Data Communication panel is one of the panels that shows up in the Functions pop up list when editing the Block Diagram. It is the panel that includes the Local Variable function.
    I don't know if the invisible item that was inserted in my block diagram was hidden or not. All I know is that the Errors List said that it was a Local Variable and that it was not connected to anything. I couldn't select it to get more information. All I could do was delete it.
    You did not address my questions about why the Copy and Paste does not work properly for my Local Variable.  Maybe it's a sign from the Software Gods not to use them LOL!..
    So if I understand correctly, you are trying to copy & paste the Local Variable from within the same VI.  How large is your block diagram?  Did you try right-click on the variable and select "Find > Local Variables"?  If it's a block diagram larger than 1 single screen (which it shouldn't), then it is possible that the Local is hiding beyond the screen.  You should find it as I described earlier.
    See my comments in red above.

  • Having trouble downloading and installing Premiere Elements 10 from my account.

    Having trouble downloading and installing Premiere Elements 10 from my account.

    Hi Jeff,
    Thanks for your reply.
    Here’s what I downloaded from my account – PremiereElements_10LS_15_win64
    I do get an error message when I double click to install:
    “The file archive part of Adobe Premiere Elements 10 is missing.
    You need all parts in the same folder in order to extract Adobe Premiere Elements 10.
    Please download all parts”.
    When on the Adobe site there are many choices which is confusing.
    Please direct me to the correct one….
    I’m running Windows 8.1
    Thank you George

  • Since Mavericks was installed I amd having trouble streaming and the fan kicks in and stays on when I am watching stream in features

    Since I installed Mavericks I am having trouble streaming and the fan turns on and stays on shortly into watching a film on line.
    Also the screen breaks up  into lines and colors with no image in the middle of viewing a film sometimes several tomes.

    Hi Mudra,
    Thanks for visiting Apple Support Communities.
    If your fan is running and you're noticing video issues when streaming video, I'd suggest first trying to reset your system, as described in this article:
    Apple computers: Troubleshooting issues with video on internal or external displays
    http://support.apple.com/kb/ht1573
    Reset the system
    You can reset the Mac's parameter RAM and SMC.
    All the best,
    Jeremy

  • I'm having trouble using my redemption code to access Lightroom?

    Can any one help I am having trouble using my redemption code to access the download of lightroom

    i am having the saame trouble with my audio book.  I can get music but no longer my book. and it makes me mad. help me too.

  • I'm having trouble writing a polynomial code.

    I'm having trouble with a polynomial code I'm supposed to conjour it. It's simply a code that adds, subtracts, and multiplies polynomials. However, there are a few methods I do not know how to come up with (I left them blank), and when I test the code write now, it doesn't work. Here's the code -- can anyone help?
    public class Polynomial implements Cloneable {
         private int m_degree;
         private double[] m_coefficient;
         // This is the default constructor
         public Polynomial() {
              super();
              m_degree = 0;
              m_coefficient = new double[5];
         // This allows the user to build a polynomial by putting a constant in
         public Polynomial(double constant) {
              this();
              m_coefficient[0] = constant;
         public Polynomial(Polynomial source) {
         // These are the getters
         public double getCoefficient(int degree) {
              return m_coefficient[degree];
         public int getDegree() {
              return m_degree;
         // These are the setters
         public void addToCoefficient(double amount, int degree) {
              m_coefficient[degree] += amount;
         public void assignCoefficient(double newCoefficient, int degree) {
              m_coefficient[degree] = newCoefficient;
         public void clear() {
              for (int i = 0; i < m_coefficient.length; i++) {
                   m_coefficient[i] = 0;
         public void reserve(int degree) {
         // These are other, useful methods
         public int nextTerm(int k) {
              int value = 0;
              return value;
         public double eval(double x) {
              double value = 0;
              // This goes through all the exponents in the polynomial
              for (int i = 0; i < getDegree(); i++) {
                   // += allows you to add instead of overriding the next term
                   value += getCoefficient(i) * Math.pow(x, i);
              return value;
         // Here is our addition method
         public static Polynomial add(Polynomial p1, Polynomial p2) {
              Polynomial newPolynomial = new Polynomial();
              // We have to find the bigger polynomial so we know how to set the loop
              if (p1.getDegree() >= p2.getDegree()) {
                   for (int i = 0; i < p1.getDegree(); i++) {
                        newPolynomial.addToCoefficient(p1.getCoefficient(i)
                                  + p2.getCoefficient(i), i);
              } else {
                   for (int i = 0; i < p2.getDegree(); i++) {
                        newPolynomial.addToCoefficient(p1.getCoefficient(i)
                                  + p2.getCoefficient(i), i);
              return newPolynomial;
         // Here is our subtraction method
         public static Polynomial subtract(Polynomial p1, Polynomial p2) {
              Polynomial newPolynomial = new Polynomial();
              // We have to find the bigger polynomial so we know how to set the loop
              if (p1.getDegree() >= p2.getDegree()) {
                   for (int i = 0; i < p1.getDegree(); i++) {
                        newPolynomial.addToCoefficient(p1.getCoefficient(i)
                                  - p2.getCoefficient(i), i);
              } else {
                   for (int i = 0; i < p2.getDegree(); i++) {
                        // The order is important with subtraction so they cannot be
                        // switched
                        // The equation is allowed to be negative, but the exponent
                        // cannot be
                        newPolynomial.addToCoefficient(p1.getCoefficient(i)
                                  - p2.getCoefficient(i), i);
              return newPolynomial;
         // Here is our multiplication method
         public static Polynomial multiply(Polynomial p1, Polynomial p2) {
              Polynomial newPolynomial = new Polynomial();
              if (p1.getDegree() >= p2.getDegree()) {
                   for (int i = 0; i < p1.getDegree(); i++) {
                        newPolynomial.addToCoefficient(p1.getCoefficient(i)
                                  * p2.getCoefficient(i), i);
              } else {
                   for (int i = 0; i < p2.getDegree(); i++) {
                        newPolynomial.addToCoefficient(p1.getCoefficient(i)
                                  * p2.getCoefficient(i), i);
              return newPolynomial;
         // Here is our clone method
         public Polynomial clone() {
              Polynomial poly;
              try {
                   poly = (Polynomial) super.clone();
              } catch (CloneNotSupportedException e) {
                   throw new RuntimeException(
                             "Class does not implement cloneable interface");
              return poly;
    }

    We've been working with arrays, and we have to write a code that adds, subtracts, and multiplies polynomials. I'm having trouble with a few of the methods. I've assigned m_degree and m_coefficient as the fields I need to use.
    Right now, as my code stands, when I test it with a polynomial in main, it doesn't work. So right now, there's a mistake preventing what I have so far from properly functioning.
    I am also having trouble writing the following methods:
    reserve: We have to allocate memory to the polynomial every time it changes so we make sure we always have enough space to work with it.
    nextTerm: We need this to jump to the next term in the polynomial, but I'm not quite sure how to do it. I didn't even realize it was possible.
    I'm horrible at commenting and explaining my code, but if you read over it just a little bit, you may be able to get the gist of what I'm trying to do. Thanks for any help, and sorry if I can't explain well.
    public class Polynomial implements Cloneable {
    private int m_degree;
    private double[] m_coefficient;
    // This is the default constructor
    public Polynomial() {
    super();
    m_degree = 0;
    m_coefficient = new double[5];
    // This allows the user to build a polynomial by putting a constant in
    public Polynomial(double constant) {
    this();
    m_coefficient[0] = constant;
    public Polynomial(Polynomial source) {
    // These are the getters
    public double getCoefficient(int degree) {
    return m_coefficient[degree];
    public int getDegree() {
    return m_degree;
    // These are the setters
    public void addToCoefficient(double amount, int degree) {
    m_coefficient[degree] += amount;
    public void assignCoefficient(double newCoefficient, int degree) {
    m_coefficient[degree] = newCoefficient;
    public void clear() {
    for (int i = 0; i < m_coefficient.length; i++) {
    m_coefficient[i] = 0;
    public void reserve(int degree) {
    // These are other, useful methods
    public int nextTerm(int k) {
    int value = 0;
    return value;
    public double eval(double x) {
    double value = 0;
    // This goes through all the exponents in the polynomial
    for (int i = 0; i < getDegree(); i++) {
    // += allows you to add instead of overriding the next term
    value += getCoefficient(i) * Math.pow(x, i);
    return value;
    // Here is our addition method
    public static Polynomial add(Polynomial p1, Polynomial p2) {
    Polynomial newPolynomial = new Polynomial();
    // We have to find the bigger polynomial so we know how to set the loop
    if (p1.getDegree() >= p2.getDegree()) {
    for (int i = 0; i < p1.getDegree(); i++) {
    newPolynomial.addToCoefficient(p1.getCoefficient(i)
    + p2.getCoefficient(i), i);
    } else {
    for (int i = 0; i < p2.getDegree(); i++) {
    newPolynomial.addToCoefficient(p1.getCoefficient(i)
    + p2.getCoefficient(i), i);
    return newPolynomial;
    // Here is our subtraction method
    public static Polynomial subtract(Polynomial p1, Polynomial p2) {
    Polynomial newPolynomial = new Polynomial();
    // We have to find the bigger polynomial so we know how to set the loop
    if (p1.getDegree() >= p2.getDegree()) {
    for (int i = 0; i < p1.getDegree(); i++) {
    newPolynomial.addToCoefficient(p1.getCoefficient(i)
    - p2.getCoefficient(i), i);
    } else {
    for (int i = 0; i < p2.getDegree(); i++) {
    // The order is important with subtraction so they cannot be
    // switched
    // The equation is allowed to be negative, but the exponent
    // cannot be
    newPolynomial.addToCoefficient(p1.getCoefficient(i)
    - p2.getCoefficient(i), i);
    return newPolynomial;
    // Here is our multiplication method
    public static Polynomial multiply(Polynomial p1, Polynomial p2) {
    Polynomial newPolynomial = new Polynomial();
    if (p1.getDegree() >= p2.getDegree()) {
    for (int i = 0; i < p1.getDegree(); i++) {
    newPolynomial.addToCoefficient(p1.getCoefficient(i)
    * p2.getCoefficient(i), i);
    } else {
    for (int i = 0; i < p2.getDegree(); i++) {
    newPolynomial.addToCoefficient(p1.getCoefficient(i)
    * p2.getCoefficient(i), i);
    return newPolynomial;
    // Here is our clone method
    public Polynomial clone() {
    Polynomial poly;
    try {
    poly = (Polynomial) super.clone();
    } catch (CloneNotSupportedException e) {
    throw new RuntimeException(
    "Class does not implement cloneable interface");
    return poly;
    }

  • I am having trouble printing  and am only getting part of the document which i have no margins set any help??

    i am having trouble printing  and am only getting part of the document  i have no margins set any help??

    What version of Pages?
    What Printer?
    If it is Pages '09, turn Comments off.
    Peter

  • Having trouble downloading and installing iTunes to my pc Windows 7

    I am having trouble downloading and installing iTunes to my PC with Windows 7.   I have been trying for 4 hours and can't get it to download.  Any suggestions?

    Do you get an error message when you try to install iTunes? If so, what does it say? (Precise text, please.)

  • Having problems uninstalling and running Photoshop CS3

    I downloaded the trial for Adobe Photoshop CS3 and it has now expired. I tried to uninstall it but it does nothing. It will not come off my computer. If I try to open it, it tells me
    The licensing subsystem has failed catastrophically. You must reinstall or call customer support. I tried redownloading and reinstalling it but it still does the same thing and customer support after waiting on hold for 10 minutes for someone to answer, just sent me here.
    How do I get rid of this program???
    Also now that this is there, I can't run my CS2. It tells me my settings have changed and I need to reactivate but it won't let me reactivate apparently I guess it's been activated too many times (the first computer I had it on crashed and so I had to reinstall it on this computer I am using now) So now because of whatever is wrong with this CS3 I can never again use my CS2. I don't want to repurchase it, what do I do??

    Having problems uninstalling and running Photoshop CS3 Lynley Stanley - 10:28am Sep 10, 2008 Pacific I downloaded the trial for Adobe Photoshop CS3 and it has now expired. I tried to uninstall it but it does nothing. It will not come off my computer. If I try to open it, it tells me the licensing subsystem has failed catastrophically. You must reinstall or call customer support. I tried redownloading and reinstalling it but it still does the same thing and customer support after waiting on hold for 10 minutes for someone to answer, just sent me here. How do I get rid of this program??? Also now that this is there, I can't run my CS2. It tells me my settings have changed and I need to reactivate but it won't let me reactivate apparently I guess it's been activated too many times (the first computer I had it on crashed and so I had to reinstall it on this computer I am using now) So now because of whatever is wrong with this CS3 I can never again use my CS2. I don't want to repurchase it, what do I do??
    In reference to Lynley Stanley, I too am having the exact problem. I downloaded as for my class of Animation and Visual Effects at the Academy of Art University while waiting for my software to come in the mail from Academic Superstore. I am so frustrated about this that such an issue has caused so much madness. In the process of trying to remove Adobe Photoshop CS3 from my Windows Vista I was searching for info on how to uninstall as I was in a hurry to uninstall the program because my 4th week into class started using the program as students are expected to follow along having their own for assignments. Well, now I'm behind and I don't want to fail because of something that is causing the problem as I'd like to call intentional. In the process of trying to figure a way to uninstall fast as not to fall behind and fail in class I downloaded Perfect Uninstaller but I don't know how it will work. Now in reference of trying to quickly uninstall just to keep up with class, that will not be possible, so now I had to take time to look online knowing I'm falling more and more behind because of this difficult matter I finally found this and hopefully I'll be going somewhere as to have the problem corrected. Alright, now I'm going to try with what has been listed. Thank you for the Info. :)

  • I am having trouble downloading and updating apps. I get a message "Error 1004 try again later" has anyone experienced this?

    I am having trouble downloading and updating my apps for my IPad2. I am getting a messahe "Error 1004 try again later". Anyone experienced this?

    Hi John
    iTunes Support wasn't of any use to me.
    I have also been having another problem - with BBC iPlayer and other video streaming not working due to insufficient bandwidth, despite my overall download speed being consistently around 50Gb.  This is also affecting AppleTV downloads
    I am using Virgin Media as my ISP, and was wondering whether you do as well.  This might be the common thread.
    -Bernard

  • Having trouble Audio and Video Syncing on iTune

    Having trouble Audio and Video Syncing on iTune anyone know how to repair?

    Here are two suggestions:
    If everything is pretty much in sync until 17 minutes in, do a re sync every ten minutes.  This should ensure that, even if the sync drifts by a few frames over 10 mins, the video will not seem distinctly out of sync at any time.
    Another approach would be to do an overall re-sync in QuickTime Pro (which I believe is part of the FCP package).
    You would need to use QTPro to trim,the video file to remove any surplus seconds of material at the beginning and end.  Then open the audio file in QT Pro and trim that if necessary.  It may be a slightly more complicated to do this at the beginning because, if the audio does not come in immediately, you'll need to make sure that you have the right amount of silence at the start of the file to match the video before the audio begins. This should leave you with video and audio files of the same length.
    Then, in the drop menus of your QT, select and copy the audio track.  Switching to the QT video file, in the drop down menus, click on add track. 
    Hope one or other of these May be some help to you.

  • I am having trouble bouncing and creating an aiff file that plays back. I've checked my output settings, and although I am able to create MP3s, the aiffs are blank. The happens when I try to export a track as an aiff file - it's blank.

    I am having trouble bouncing and creating an aiff file that plays back. I've checked my output settings which appear to be correct. Although I am able to create MP3s, the aiffs are blank. The happens when I try to export a track as an aiff file - it's blank.

    When bouncing, do you use the Key Command or the button on the Output Channel Strip? The Key Command only bounces from the Stereo Output. The bounce button bounces from the Channel Strip it is on. So if you want to bounce out outputs 3-4 or higher, don't use the key command, but the button.
    The strange thing here is that Logic, when it bounces an MP3, first bounces an AIFF, which at the end of the bounce process is being converted to MP3, so I can't imagine how you can get a silent AIFF and a normal MP3.
    How have you listened to those bounces? iTunes? Quicklook? Quicktime?

  • I am having trouble installing and updating apps?

    I am having trouble updating and installing new apps.  Please help.

    Try here:
    Can't connect to the iTunes Store
    However, it may be an Apple server problem since other have posted with the same problem.

Maybe you are looking for

  • Drag and Drop CSV file onto a table in Number

    Hi everyone ! I really love the new version of iWork. However I can't find a feature I was heavilly using which is the drag and drop of a CSV file into numbers which creates the table associated to this file. Is there anyone who has find a way to re-

  • Tablespace creation problem in RAC using raw device.

    Hi , If i created a tablespace with the .dbf extension i am able to create the tablespace. on other hand if i use .dbf extension it;s failing.. can anyone help me out why it is happening?? here is the code... Oracle9i Enterprise Edition Release 9.2.0

  • Whenever i open a new tab, a website opens up, even though i have set a blank page as the opening page. How do i stop this?

    When i open a new tab it automatically goes to "http://www.bigseekpro.com/search/dns/anyvideo2dvd/{F8DC2913-2606-401B-8AED-0345AD711130}?q=bigseekpro.com/anyvideo2dvd/{F8DC2913-2606-401B-8AED-0345AD711130}?s_src=newta" This started after i had instal

  • Winforms app keeps asking for config

    I have multiple apps that keep asking me for an XML config file. These are existing apps that I loaded from TFS. There is an app.config file in the solution. Thoughts? *** Please allow me to mark threads as answered and I will, Thank you ***

  • Regarding perfrommance tuning

    hi expert, i am having 5 millions records i want to insert record in a table which statement is faster from following. 1 insert into test1 values() select * from test 2 using bulk collect plz can me help me which one is the improvement of performance