Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2472
  • Last Modified:

Configure Java with jcreator

Hi,
    I am trying to configure my java using Jcreator. I cant firure it out but this is what comes up when i go to compile it. Mabey someone can help me.

--------------------Configuration: j2re1.4.0 <Default>--------------------
Invalid command line. Error : Invalid path

Command   : "C:\Program Files\Java\j2re1.4.0\bin\javac.exe" -classpath "C:\Program Files\Java\bin" -d "C:\Program Files\Java\bin" "C:\Program Files\Java\bin\CounterUpDown.java"
Directory : C:\Program Files\Java\bin
0
neocytrix
Asked:
neocytrix
2 Solutions
 
objectsCommented:
> C:\Program Files\Java\j2re1.4.0\bin\javac.exe

javac is not a part of the jre.
It is part of the jdk.
0
 
neocytrixAuthor Commented:
Where can i download the JDK I only see the JRE and SDK at java.sun.com
0
 
neocytrixAuthor Commented:
ok I figured that part out i just put in the SDK and it compiled fine. But now i go to run it and the command prompt comes up with this

Exception in thread "main" java.lang.NoSuchMethodError: main
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
neocytrixAuthor Commented:
ok I figured that part out i just put in the SDK and it compiled fine. But now i go to run it and the command prompt comes up with this

Exception in thread "main" java.lang.NoSuchMethodError: main
0
 
girionisCommented:
 Are you sure your application contains a "main" method?
0
 
neocytrixAuthor Commented:
Ok i got the applet veiver to come up. but i can see the applet. it just says

Dispose: applet not distroyed

this is the source code if anyone can find anything wrong with it

import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;

public class CounterUpDown
  extends Applet
  implements ActionListener
{  
  private Button upButton = new Button("+1");
  private Button downButton = new Button("-1");
  private int counter = 0;
 
  public void init() {
    add(downButton);
    add(upButton);
    downButton.addActionListener(this);
    upButton.addActionListener(this);
  } // init
 
  public void paint(Graphics g) {
    g.drawString("Count: "+counter, 70, 50);
  }// paint
 
  public void actionPerformed(ActionEvent e) {
    // Might be a "-1" or a "+1" button click
    // Check the event's "source" and act accordingly
    if (e.getSource() == downButton) {
      counter = counter-1;
    }
    else {
      // Must be upButton
      counter = counter+1;
    }
    repaint();
  } // actionPerformed
 
} // class CounterUpDown
0
 
girionisCommented:
 So it is an applet that's why it couldn't find a main method. Try to run it from the command promptp and see if you can run it. If your HTML file that runs the applet is called "MyFile.html" run it by using\; appletviewer MyFile.html

  Also a good tutorial on JCreator can be found here: http://www.javaworld.com/javaworld/jw-11-2002/jw-1101-java101.html
0
 
CleanupPingCommented:
neocytrix:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
jimmackCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Split between objects and girionis.

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jimmack
EE Cleanup Volunteer
0
 
girionisCommented:
 I agree :)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now