Beginning College Java Project. Help Me Please !!!

The following is code that im writing for a program that will play a game between the user and the computer. I am getting an error message saying "CLASS EXPECTED".
The error is pointing me to the playerChoose Method where the variable pcchoice is trying to accept the value inputted by the user.
I am a beinner to the Java Language and am having difficulty understanding what the problem is or what the error means.
Can someone please help me!!!
import java.io.*;
import java.util.Random;
class NIM
public static void main (String [] args) throws IOException
     int game = 21; //Keeps Track of sticks remaining.
     Random random = new Random();
     PrintInstructions ();
     playerChoose();
     game = game - pchoice;
     computerChoose();
     game = game - cchoice;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
static void PrintInstructions ()
     System.out.println ("You are going to play the game NIM.\n");
     System.out.println ("In this version of NIM, there are 21 sticks on the table.");
     System.out.println ("On each move, the user and the computer take turns picking");
     System.out.println ("up 1,2 or 3 sticks until there are no more sticks left.");
     System.out.println ("The one who picks up the last stick loses.\n");
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
static int playerChoose()
     pchoice = 0;
     BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
     System.out.println ("Choose your sticks. Enter 1-2 or 3.");
     pchoice = int.ParseInt(in.readline);
     while pchoice = 1
     return(pchoice);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
static int computerChoose()
     int cchoice = 0;
     for (i= 1; i<=50; i++)
     cchoice = random.nextInt(3)+1;
     return(cchoice);
}

In this line
pchoice = int.ParseInt(in.readline);you are wanting to parse the String entered from the keyboard as an int.
One way to do that is to use the parseInt method from the Integer class.
To use a static method from a class you start with the name of the class, followed by the name of the method (with the correct capitalization!), like this:
pchoice = Integer.parseInt(in.readline);The following line is missing parentheses; add them as below:
while (pchoice = 1)These corrections will expose more errors that can then be fixed.

Similar Messages

  • Very simple java project (help please)

    Hello. For a project I have to somehow use MouseListener to make something. My idea was to have a rectangle in which a circle (hockey puck) follows the user's mouse and whenever the user places the circle into a certain area the count goes up by one (like a game of hockey). If someone could give me some idea as to where I should start it would be greatly appreciated.
    My thanks

    This is alwyas [a good place to start|http://java.sun.com/developer/onlineTraining/] when you don't have a clue what's going on, and here if you need specifics on MouseListener. And to get movement, then you'll probably want to look here.
    Once you have some code and specific questions, literally almost everyone on here will be willing to help you further along the way. When you post code, please use code tags.

  • Java project help

    Hey guys, im thinking of changing my major to computer engineer in college i got this problem in principle of comp. class. its based on java programing and writing the codes. im having a hard time with writing code and our teacher will only give me so much help. is there anyone here that is familiar with java and i can email you my problem and you give me an idea of what to do and how it should look. thanks for the help guys

    I told you I'd do it for you if you posted it. I
    wasn't kidding.Yes, OP go ahead and let Jerkweed do it for you. I'm
    sure it will be done correctly and that you'll learn
    alot from copying whatever mess of a solution he
    might provide.Seriously dude I don't know what your problem is, but how about you just ignore me. I'll do my thing, you do yours.

  • Basic java problem help needed please

    the problem is :
    to produce a program which will show membership rates for a golf club..
    membership yearly rate new member joining fee
    category
    full 650 3000
    associate 200
    ladies 350 2000
    under 18 175
    new members must pay a joining fee in addition to the yearly rate as shown
    full/ladies members also prepay 150
    write a program which will enter details of members,calculate and output the total amount each member should pay.
    output number of members in each category
    the total income for each category....
    i need this program to show each category individually...cant do it at all..been at it a week....must be me && and || signs...i think...plz can someone help me as im really stuck now...thank you so much..
    import java.util.Scanner;
    public class assignmentquestion3 {
    public static Scanner key=new Scanner(System.in);
    public static void main(String []args){
    int fullfee=800,newfullfee=3800,associatefee=200,newla diesfee= 2350,ladiesfee= 350,under18fee = 175;
    int selectcat=0;
    int reply = 0;
    int addmember=0;
    int currentfulltotalmem=0,newfulltotalmem=0,associatet otalmem=0,ladiestotalmem=0,under18totalmem=0;
    int assoctotalcash=0,ladiestotalcash=0,under18totalcas h=0;
    int fullprepay=150;
    int ladiesfull=2500;
    int completefull = 0;
    int ladiescurrent=500;
    int under18=175;
    //Main introduction screen for the user and selections available. do while loops only allowing numbers 1,2,3 or 4.
    do{
    do{
    System.out.printf("\n\t %90s","********************Membership Rates For The Golf Club********************");
    System.out.printf("\n\n %105s","This program will allow users to enter details of members as well as calculating and.");
    System.out.printf("\n%106s","outputing the total amount each member should pay. The program allows users to view the");
    System.out.printf("\n%106s","total number of members in each category and the total income for each category.");
    System.out.printf("\n\n\t %75s","Please select your membership category: ");
    System.out.printf("\n\n\t %68s","Please press '1' for FULL");
    System.out.printf("\n\n\t %68s","Please press '2' for ASSOCIATE");
    System.out.printf("\n\n\t %68s","Please press '3' for LADIES");
    System.out.printf("\n\n\t %68s","Please press '4' for UNDER 18");
    System.out.printf("\n\n\t %68s","Please enter 1,2,3 or 4: ");
    selectcat=key.nextInt();
    }while (selectcat>4 || selectcat<1);
    do{
    System.out.printf("\n\n\t %75s","Are you a Current Member (press 1) or a New Member (press 2): ");
    reply=key.nextInt();
    }while (reply<1 || reply>2);
    //if number '1' for 'FULL' category is selected by the user and reply is 'yes'(1) then new full member fee is shown to user
    if (selectcat==1 ||reply==1)
    System.out.printf("\n\n\t %68s","CURRENT FULL MEMBERSHIP SELECTED");
    System.out.printf("\n\n\t %68s","Current full membership fees yearly are "+fullfee+"");
    System.out.printf("\n\n\t %68s","Full members must also pre-pay "+fullprepay+" on a card can be used in the club facilities such as bar and shop ");
    System.out.printf("\n\n\t %72s","The total of this membership is: "+fullfee+"");
    currentfulltotalmem=currentfulltotalmem+1;
    System.out.printf("\n\n\t %72s","The total number of 'CURRENT FULL MEMBERSHIPS = "+currentfulltotalmem+"");
    completefull=completefull+fullfee;
    System.out.printf("\n\n\t %68s","The total amount of income for 'FULL MEMBERSHIPS' within the club = "+completefull+"");
    //if number '1' is selected by the user and reply is 'no' (2) then full member fee is shown to user
    else if (selectcat==1 &&reply==2)
    System.out.printf("\n\n\t %68s","NEW FULL MEMBERSHIP SELECTED");
    System.out.printf("\n\n\t %68s","Full membership fees yearly are "+newfullfee+"");
    newfulltotalmem=newfulltotalmem+1;
    System.out.printf("\n\n\t %68s","The total number of 'NEW FULL MEMBERSHIPS = "+newfulltotalmem+"");
    completefull=completefull+newfullfee;
    System.out.printf("\n\n\t %68s","The total amount of income for 'FULL MEMBERSHIPS' within the club = "+completefull+"");
    //if number '2' is selected by the user then associate member fee is shown to user
    if (selectcat==2 &&(reply==1 || reply==2))
    System.out.printf("\n\n\t %75s","ASSOCIATE MEMBERSHIP SELECTED");
    System.out.printf("\n\n\t %75s","ASSOCIATE membership fees yearly are "+associatefee+"");
    associatetotalmem=associatetotalmem+1;
    System.out.printf("\n\n\t %75s","The total number of 'ASSOCIATE MEMBERSHIPS' WITHIN THE CLUB = "+associatetotalmem+"");
    assoctotalcash=assoctotalcash+associatefee;
    System.out.printf("\n\n\t %68s","The total amount of income for 'ASSOCIATE MEMBERSHIPS' within the club = "+assoctotalcash+"");
    //if number '3' is selected by the user and reply is 'yes' then new ladies member fee is shown to user
    if (selectcat==3 &&reply==1)
    System.out.printf("\n\n\t %68s","LADIES CURRENT MEMBERSHIP SELECTED");
    System.out.printf("\n\n\t %68s","Ladies full membership fees yearly are "+ladiesfee+"");
    System.out.printf("\n\n\t %68s","Ladies must also pre-pay "+fullprepay+" on a card can be used in the club facilities such as bar and shop ");
    System.out.printf("\n\n\t %68s","The total of this membership is: "+ladiescurrent+"");
    ladiestotalmem=ladiestotalmem+1;
    System.out.printf("\n\n\t %75s","The total number of 'LADIES MEMBERSHIPS' WITHIN THE CLUB = "+ladiestotalmem+"");
    ladiestotalcash=ladiestotalcash+ladiescurrent;
    System.out.printf("\n\n\t %68s","The total amount of income for 'LADIES MEMBERSHIPS' within the club = "+ladiestotalcash+"");
    //if number '3' is selected by the user and reply is 'no' then the current ladies member fee is shown to user
    else
    if (selectcat==3 && reply==2)
    System.out.printf("\n\n\t %68s","LADIES NEW MEMBERSHIP SELECTED");
    System.out.printf("\n\n\t %68s","LADIES NEW MEMBERSHIP fees yearly are "+newladiesfee+"");
    System.out.printf("\n\n\t %68s","Ladies must also pre-pay "+fullprepay+" on a card can be used in the club facilities such as bar and shop ");
    System.out.printf("\n\n\t %68s","The total of this membership is: "+ladiesfull+"");
    ladiestotalmem=ladiestotalmem+1;
    System.out.printf("\n\n\t %75s","The total number of 'LADIES MEMBERSHIPS' within the club = "+ladiestotalmem+"");
    ladiestotalcash=ladiestotalcash+ladiesfull;
    System.out.printf("\n\n\t %68s","The total amount of income for 'LADIES MEMBERSHIPS' within the club = "+ladiestotalcash+"");
    //if number '4' is selected by the user then under 18 member fee is shown to user
    else if (selectcat==4 &&(reply==1||reply==2))
    System.out.printf("\n\n\t %75s","UNDER 18 MEMBERSHIP SELECTED");
    System.out.printf("\n\n\t %75s","UNDER 18 yearly membership fees are "+under18fee+"");}
    System.out.printf("\n\n\t %68s","The total of this membership is: "+under18+"");
    under18totalmem=under18totalmem+1;
    System.out.printf("\n\n\t %75s","The total number of 'UNDER 18 MEMBERSHIPS' within the club = "+under18totalmem+"");
    under18totalcash=under18totalcash+under18;
    System.out.printf("\n\n\t %68s","The total amount of income for 'UNDER 18 MEMBERSHIPS' within the club = "+under18totalcash+"");
    //allowing user to select '0' to add another member or any other key to exit program
    System.out.printf("\n\n\t %68s","Please Press '0' to add another member or any other key to exit.: ");
    addmember=key.nextInt();
    }while (addmember==0 ||addmember>1);}}
    the problem im having is whenever i make the choices 1,2,3,4 (CATEgorys) AND hit 1 or 2(current or new member selections) it brings up more than one category...
    for example when i hit 1(Category full) and 1(current member)..it displays this:
    Are you a Current Member (press 1) or a New Member (press 2): 1
    CURRENT FULL MEMBERSHIP SELECTED
    Current full membership fees yearly are 800
    Full members must also pre-pay 150 on a card can be used in the club facilities such as bar and shop
    The total of this membership is: 800
    The total number of 'CURRENT FULL MEMBERSHIPS = 1
    The total amount of income for 'FULL MEMBERSHIPS' within the club = 800
    The total of this membership is: 175
    The total number of 'UNDER 18 MEMBERSHIPS' within the club = 1
    The total amount of income for 'UNDER 18 MEMBERSHIPS' within the club = 175
    Please Press '0' to add another member or any other key to exit.:
    under 18 membership as well?...does this for other selections too...is it my arithmetic operators?....my if loops?...

    Multi-post [http://forums.sun.com/thread.jspa?threadID=5346248&messageID=10498270#10498270]
    And it still doesn't compile.

  • Importing XML into Java.  Help needed Please!!!

    Hi,
    I have downloaded j2sdk1.4.1_05 and want to configure it to import XML files into a DOM in Java. I am having trouble doing this and need help. I read that version 1.4 support JAXP 1.1 but I am having trouble finding the JAXP-api.jar file. It says to put all the other Jar files into a folder and leave the JAXP-api.jar.
    Could you please tell me how to set up Java so that I can import an XML file. I also downloaded JAXP 1.2. But there seems to be no installer.
    Thanx John

    You can learn about reading xml in java by reading the J2EE tutorial at
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/
    Here is sample program to read XML file into a DOM taken from this tutorial
    (http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXPXSLT4.html)
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.FactoryConfigurationError;
    import javax.xml.parsers.ParserConfigurationException;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import org.w3c.dom.Document;
    import org.w3c.dom.DOMException;
    import java.io.*;
    public class TransformationApp
      static Document document;
      public static void main(String argv[])
        if (argv.length != 1) {
          System.err.println (
            "Usage: java TransformationApp filename");
          System.exit (1);
        DocumentBuilderFactory factory =
          DocumentBuilderFactory.newInstance();
        //factory.setNamespaceAware(true);
        //factory.setValidating(true);
        try {
          File f = new File(argv[0]);
          DocumentBuilder builder =
            factory.newDocumentBuilder();
          document = builder.parse(f);
        } catch (SAXParseException spe) {
          // Error generated by the parser
          System.out.println("\n** Parsing error"
            + ", line " + spe.getLineNumber()
            + ", uri " + spe.getSystemId());
          System.out.println("  " + spe.getMessage() );
          // Use the contained exception, if any
          Exception x = spe;
          if (spe.getException() != null)
            x = spe.getException();
          x.printStackTrace();
        } catch (SAXException sxe) {
          // Error generated by this application
          // (or a parser-initialization error)
          Exception x = sxe;
          if (sxe.getException() != null)
            x = sxe.getException();
          x.printStackTrace();
        } catch (ParserConfigurationException pce) {
          // Parser with specified options can't be built
          pce.printStackTrace();
        } catch (IOException ioe) {
          // I/O error
          ioe.printStackTrace();
      } // main
    } If you have java 1.4 sdk installed everything should compile and run. Separate
    JAXP package is nor required - JAXP is included in rt.jar in java-home-directory/jre/lib.

  • First individual java project, help to get started

    Hi first of let me introduce myself,
    I am Koos, 16.75 years old and from Holland. At school we are learning or suppossed to learn java language, that's how I got interested in java, anyway it isn't going that great so far.
    But I already created my first assignment a tool which counts the letters in a word, in a JFrame of course to make it look better.
    I use Eclipse to program java (what is in you opinion the best program to program in java?) and have of course installed the JDK.
    Now to get to the point, I want to contribute to a site I often visit to make a java calculation applet.
    The main Idea is to make a new window where calculations are done by multiple inputs and outputs. It's doing some simple maths such as percentage, division and multiplication.
    I would like to implement different data (different currency (Eur,Usd,Gbp) and pairs(EurChf,EurGbp GbpChf and UsdCad), and then all options possible,
    from [this tool|http://www.goforex.net/pip-calculator.htm] , could that be possible to automate or is it better to manually put in?
    I will update in an hour or so with a formula, if you would like, I already have the principal in excel so I could upload that if you'd like that.
    Regards,
    Koos

    Hi I have written the part for the window and the input fields but the fields don't show up what's wrong in the code?
    import javax.swing.*;
    public class Window extends JFrame {
         public static void main(String[] args){
              new Window();
         public Window() {
         JFrame frame = new JFrame("Fapturbo LRR calculator");
              this.setSize(500, 400);
              this.setVisible(true);
              this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JPanel area = new content;
              this.setContentPane(content);
              this.setVisible(true);
              this.setLocationRelativeTo(null)
    class content extends JPanel {
         private JLabel Lotsriskreduction,equity,priceEURGBP,priceEURCHF,priceUSDCAD,priceGBPCHF;
         private JButton Calculate;
         private int inputLRR,inputEQ,inputP1,inputP2,inputP3,inputP4;
         private JTextField input1;
         public content() {
              this.setLayout(null);
              input1 = new JTextField();
              this.add(input1);
              input1.setBounds(24, 80, 210, 20);
              /// Here comes the calculation folowing the formula I posted before including their outputs/
              //in the same kind of field as the input.
              Calculate = new JButton("Calculate");
              Calculation kh = new Calculation();
    }regards,
    Koos

  • Java.lang.UnsatisfiedLinkError - Urgent please help

    Hi,
    I want to thank you for looking into this problem first.
    I have a very headache problem for the past week. I have an applet that uses JNI to call an existing dll to get the system resources. It works fine on windows 2000 server with IE 5.0. The dll get loaded fine and the function call is working fine.
    However, now I tried to move the applet to an application for me to test with jbuilder, I have problems and I get the error java.lang.UnsatisfiedLinkError: ooInit.
    Does anyone know why this is happening in Jbuilder. I traced to see if the dll get loaded with System.loadlibrary("dll"), and it seems to load the library. But when I call the ooInit() native method, it throws that exception.
    Please help. This will be greatly appreciated and I can do something for you guys in return.
    Thank you so much.
    Regards,
    guna

    Here, for the benefit of others who might search for this, is my approach to resolving this error.
    Two things to note:
    1. I didn't worry about paths, etc. - I was in a hurry so I just copied files into required directories.
    2. I named both the Java and C files "mainFrame". I have not subsequently checked to see if this is required, since it worked for me.
    Summary of getting jni routine to work with Jbuilder:
    created Java project mintest, two principle classes - mainFrame and WelcomeFrame
    key code fragments:
    --------------------------------------- mainFrame --------------------------------------------------
    package mintest;
    import javax.swing.JLabel;
    import javax.swing.JButton;
    import javax.swing.JPanel;
    import java.awt.GridBagLayout;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseAdapter;
    public class mainFrame {
        boolean packFrame = false;
        WelcomeFrame frame = new WelcomeFrame();
        public static native int cRoutine(int value);
        static {System.loadLibrary("mainFrame"); }
    public mainFrame() {
        //Pack frames that have useful preferred size info, e.g. from their layout
        //Validate frames that have preset sizes
        if (packFrame) {
          frame.pack();
        else {
          frame.validate();
        // Center the frame
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension frameSize = frame.getSize();
        if (frameSize.height > screenSize.height) {
          frameSize.height = screenSize.height;
        if (frameSize.width > screenSize.width) {
          frameSize.width = screenSize.width;
        frame.setLocation( (screenSize.width - frameSize.width) / 2,
                          (screenSize.height - frameSize.height) / 2);
        frame.setVisible(true);
        try {
          jbInit();
        catch (Exception ex) {
          ex.printStackTrace();
    * Main method
    * @param args String[]
    static public void main(String[] args) {
      try {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
      catch (Exception e) {
        e.printStackTrace();
      new mainFrame();
            cRoutine(1);     // this works at this point...
            System.out.println("cRoutine - should be 4: " + cRoutine(3));
      private void jbInit() throws Exception {
    }--------------------------------------- end of mainFrame --------------------------------------------------
    --------------------------------------- (portions of) WelcomeFrame --------------------------------------
    package mintest;
    import java.awt.*;
    ..... more imports, setting up of window, buttons, etc. .... iValue is an integer....
      public void jToggleButton1_mousePressed(MouseEvent e) {
          jToggleButton1.setText("cRoutine in: " + iValue + "  out: " + (iValue = 
                                   mainFrame.cRoutine(iValue)));
      }--------------------------------------- end of (portions of) WelcomeFrame -----------------------------
    mainFrame was compiled with Jbuilder into a class file, makeFrame.class. That was copied into
    the C:\Borland\JBuilder2005\jdk1.4\bin directory, and javah was run to create the C header file:
    javah -jni mainFrame
    This generated:
    --------------------------------------- mainFrame.h generated by javah ----------------------------------
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class mainFrame */
    #ifndef _Included_mainFrame
    #define _Included_mainFrame
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class:     mainFrame
    * Method:    cRoutine
    * Signature: (I)I
    JNIEXPORT jint JNICALL Java_mainFrame_cRoutine
      (JNIEnv *, jclass, jint);
    #ifdef __cplusplus
    #endif
    #endif--------------------------------------- end of mainFrame.h generated by javah -------------------------
    OKAY, HERE COMES THE CRITICAL STEP. DESPITE THE FACT THE COMMENT SAYS DO NOT EDIT, THIS FILE HAS TO BE EDITED TO INCLUDE THE PACKAGE NAME, LIKE THIS:
    --------------------------------------- modified mainFrame.h ----------------------------------
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class mainFrame */
    #ifndef _Included_mainFrame
    #define _Included_mainFrame
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class:     mainFrame
    * Method:    cRoutine
    * Signature: (I)I
    JNIEXPORT jint JNICALL Java_mintest_mainFrame_cRoutine
      (JNIEnv *, jclass, jint);
    #ifdef __cplusplus
    #endif
    #endif--------------------------------------- end of modified mainFrame.h -------------------------
    This file is then copied to the C:\Borland\BCC55\Include directory. The C code source is placed
    in the C:\Borland\BCC55\Bin directory. Here is the C code - note that it has the package name in
    the function name:
    --------------------------------------- mainFrame.c ----------------------------------
    #include <mainFrame.h>
    #include <stdio.h>
    #include <string.h>
    /* must link gpib-32.obj for Windows*/
    #include <windows.h> /*if using Windows */
    void main(){
    JNIEXPORT jint JNICALL
    Java_mintest_mainFrame_cRoutine(JNIEnv *env, jobject callingObj,jint invalue)
    return (jint) invalue+1;
    }--------------------------------------- end of mainFrame.c -------------------------
    This is now compiled on the command line (from the C:\Borland\BCC55\Bin directory) using:
    bcc32 -tWD -I\Borland\bcc55\include -L\Borland\bcc55\lib mainFrame.c
    Parameters: -tWD creates Windows DLL file
    -I is path to include directory (this is where mainFrame.h is located)
    -L is path to library directory
    Compilation produces mainFrame.dll in the C:\Borland\BCC55\Bin directory. This is copied to the C:\Borland\JBuilder2005\jdk1.4\jre\bin directory so Jbuilder can find it. Then it works.
    So, the key step is adding the package name after javah has generated the header file (and similarly using the package name in the .c source file.)
    Hope this is useful.

  • Devoloping project help for java projects

    hi
    we have done a project using java swings. now we need to provide project help documentation, and
    that help should be accessed from the menu.
    can u please give me any approch for this?
    thank u
    sarabh.

    You can start from this point.
    http://java.sun.com/developer/JDCTechTips/2002/tt0423.html

  • Too large java heap error while starting the domain.Help me please..

    I am using weblogic 10.2,after creating the domain, while starting the domain,I am getting this error.Can anyone help me.Please treat this as urgent request..
    <Oct 10, 2009 4:09:24 PM> <Info> <NodeManager> <Server output log file is "/nfs/appl/XXXXX/weblogic/XXXXX_admin/servers/XXXXX_admin_server/logs/XXXXX_admin_server.out">
    [ERROR] Too large java heap setting.
    Try to reduce the Java heap size using -Xmx:<size> (e.g. "-Xmx128m").
    You can also try to free low memory by disabling
    compressed references, -XXcompressedRefs=false.
    Could not create the Java virtual machine.
    <Oct 10, 2009 4:09:25 PM> <Debug> <NodeManager> <Waiting for the process to die: 29643>
    <Oct 10, 2009 4:09:25 PM> <Info> <NodeManager> <Server failed during startup so will not be restarted>
    <Oct 10, 2009 4:09:25 PM> <Debug> <NodeManager> <runMonitor returned, setting finished=true and notifying waiters>

    Thanks Kevin.
    Let me try that.
    Already more than 8 domains were successfully created and running fine.Now the newly created domain have this problem.I need 1GB for my domain.Is there any way to do this?

  • Help me please someone...In the middle of auditioning loops within a project, all my loops started sounding all wobbly like they are out of phase or something. what can i do to fix this. Thanks

    Help me please someone...In the middle of auditioning loops within a project, all my loops started sounding all wobbly like they are out of phase or something. what can i do to fix this. Thanks

    raise your I/O buffer and raise your Process Buffer Range.
    Logic Pro>Preferences>Audio>Devices>Coreaudio

  • Missing java file via eclipse.please help

    There is a java file missing in my eclipse when i do an update
    via svn.
    the error class the class shows 'Trade cannot be resolved to a type
    How do I import via SVN fo that specific file that is missing?
    I tried doing a fresh update but still its missing?
    please help

    Suresh,
    there are multiple ways to achieve that. If it is a "pure" java application create a java project.
    If you put java files into portal, webservice etc projects, they be compiled with the projects build process.
    To compile a single class you have also the option to configure an entry in the tool section (which points to javac for example) and run the tool, when your file is open (like in Visual Studio).
    -kai

  • Can't open my project, help please...

    I've spent hours and hours on my wedding video project... When I was working on it, iMove suddenly crashed and then I can't open the project any more...
    I can't open, edit, duplicate and export the project. It allows me to play it in full screen but the content is incomplete.
    My other two projects are fine.
    I tried to reinstall iMovie (delete the program and com.apple.pkg.iMovieXXXX files, and reinstall and update) but it didn't help...
    I tried to repair the disk permissions but it didn't help...
    Could anyone please save me and my project..
    I was using Lion and iMovie 11 with the latest updates. My labtop is MBP 15'' mid-2010.
    Thanks!

    Anyone could help me please ???

  • After mixing a project i select bounce and burn the disc that is burned plays on any cd player but when i try to burn the wav or mp3 file that was created the resulting disc will only play in a computer this also happens with video projects help please

    after mixing a project i select bounce and burn the disc that is burned plays on any cd player but when i try to burn the wav or mp3 file that was created the resulting disc will only play in a computer this also happens with video projects help please are there any settings i need to alter as it seems the wav or mp3 file i ceated is being converted to a data file somewhere between the folder and disc drive

    Same thing for a movie file.. If you want to play back the movie via a DVD and a DVD player you must create a Movie DVD  and not just burn files to a data DVD... as Data DVDs are just storage devices for files and therefore will only work with computers...
    Movie DVDs are special formats that include things like menus and special file formats.. so they can playback via a DVD Player...
    You will need a 3rd party DVD Burning app like Toast which is what i actually use.... or the more popular DVD Creator app...to create and then burn a Movie DVD that will playback on a DVD Player....
    https://answers.yahoo.com/question/index?qid=20101220205435AA70beb

  • My first real life java project is going horribly wrong plz help

    my family has a marina and i said i can make a program to help my dad keep track of the boats and rentals etc. but the problem im having trouble im relatively new i have only been doing java for 3 weeks and its hard. My dad gave me an outline for the project. this is what i have so far.
    The File menu contains two items in addition to the Exit item from the JCreator template: Open and Save. The main tab will have other tabs added later.
    Step 2: Design and implement the Boat class:
    The Boat class describes a boat owned by the marina. Each boat has a name, a daily rental price and is moored in a slip at the marina. The marina need to keep track of each boat's status: 0 - available, 1 - reserved and 2 - rented. Slips are numbered from 1 to 6 right now, but the owners are thinking of adding more slips as their business grows. In designing this class, consider how the class will be used within the project. Try to think of all possible instance variables and methods your class might need.
    Review Topics:
    Creating classes: Instance variable, Get and Set Methods
    Menus
    Tabbed Panes
    Step 3: Design and implement the Marina class
    The marina class is used to hold all the Boat objects. Since there is no imaginable limit to the number of boats the marina might one day own, the Marina class should use an ArrayList object to hold all the Boat objects. Also implement the Open and Save menu items.
    Review Topics:
    The ArrayList class
    Object Files ... writing, reading, the Serializable interface
    Using the FileDialog class.
    Step 4: Design and implement the Customer and CustomerList classes.
    Each Customer is a Person who wants to rent a Boat. For identification purposes, each Customer is assigned a Customer number. This String value is a 6-digit number generated sequentially. That is, the first customer will be 000001, the second 000002, and so on. The Customer class must keep track of the Customer's Boat choices (past and present).
    The CustomerList class is a dynamic list of Customer objects. Customers come and go, so this class must have functionality that allows for the addition of new customers, deletion of customers and the editing of customer information, including changing their Boat rental options. Create methods within the CustomerList class that will read data from and write data to a data file.
    Add a new tab to the GUI allowing the user to enter a customer's first and last names, add these Customer objects to the CustomerList and save the Customer information on data files.
    i would prefer if you keep the code as simple as possible cause im new and i wont understand if you get all fancy.
    http://www.java-forums.org/new-java/8917-having-trouble-java-project.html you can find the attachment of the project files there.

    raakesh wrote:
    my family has a marina and i said i can make a program to help my dad keep track of the boats and rentals etc. but the problem im having trouble im relatively new i have only been doing java for 3 weeks and its hard.This is a real bad idea. The reason is that it's an enormous difference between a toy program and a professional product. You could get a version up and running in less than a week but it will be nowhere near what your dad envisioned. To meet even moderate expectations you'll have to put in at least 3-6 months fulltime. This is why bespoke software is so expensive. And even so there's a 90% chance the program will be dropped because your dad feels the manual system worked better. The only thing a project like this is likely to accomplish is to drive a wedge between you and your dad.
    I know you're bullshitting to get schoolwork help but still I want to warn others for this kind of projects. They're doomed.

  • Help Java project.

    know its horrible... I feel horrible about it; i'm still working on it but this Java project is killing me... Just so you know i dont have to know programing after this class, i just had a choice between 3 computer classes and picked the one i guess i'm worst at... I've done four major projects before this one. I average getting about 75% correct. We code in BlueJ...The reason i'm finally breaking down for help is it was due on November 21st. o well enough of my babble if ur going to help ur going to help; if not ur not.
    Heres the assignment
    Open the project cards containing your code for class PlayingCard and create the two new
    classes in this project space:
    Part 4: Implement class CardDeck that has the following declaration:
    public class CardDeck {
    private PlayingCard[] deck;
    public static final int DECK_SIZE = 52;
    //number of cards still in the deck:
    private int numCardsLeft;
    public CardDeck(){ ? }
    private void removeCard(int index){ ? }
    public void shuffle(){ ? }
    public void wholeDeck(){ ? }
    public PlayingCard topCard(){ ? }
    public PlayingCard anyCard() { ? }
    In your implementation, you must follow these guidelines:
    1. Constructor of the class must properly initialize the CardDeck object: create the array object with number of "compartments" equal to DECK_SIZE and assign it to the field deck ; then create all 52 cards in such a way that there are no duplicate cards in the deck. You must use Java loop(s) to create the above PlayingCard objects. In addition, the constructor must assign the value DECK_SIZE to the field numCardsLeft.
    2. Method removeCard(int index) must first check that the index is between 0 and the value of numCardsLeft-1. If it is true, then the method must
    ? shift all the cards in the deck array starting with index+1 and up to
    numCardsLeft-1 position left by one "compartment"
    ? set the last value in the deck to null, like so:
    deck[numCardsLeft-1] = null;
    ? decrement value of numCardsLeft by 1
    3. Method shuffle()randomly re-arranges cards in the deck:
    a) Declare a local variable temp of the type PlayingCard
    B) Generate two random numbers i and j between 0 (inclusive) and DECK_SIZE
    (exclusive) and swap the two cards stored at these index positions in the array:
    temp = deck;
    deck[i] = deck[j];
    deck[j] = temp;
    Repeat step B) at least 50 times, to get a good shuffle!
    4. Method wholeDeck() must display descriptions of all the cards in the deck on screen. In order to do this, use an enhanced for loop to iterate through the deck array, and for each PlayingCard element of it call method describeCard() of class PlayingCard.
    5. Method topCard()calls removeCard with 0 passed as the parameter value, and
    returns a copy of PlayingCard object that was removed (that is, the card that used to be at index 0 in the array, before we removed it).
    6. Method anyCard() removes a PlayingCard object stored at a random index in the
    array: using an object of class java.util.Random, generate a random number between 0 and numCardsLeft-1, and pass this value as the parameter to the method
    removeCard. Method anyCard must return a copy of the of PlayingCard object that
    was removed.
    Part 5: Implement class CardDeckTest that contains only the method
    public static void main (String[] args) which does the following:
    ? create an object of type CardDeck
    ? call the method wholeDeck()
    ? call the method shuffle()
    ? call the method wholeDeck() again
    ? call the method topCard(), store its result in a variable, and then use this variable to call method displayCard()of class PlayingCard
    ? call the method anyCard(), store its result in a variable, and then use this variable to call method displayCard()of class PlayingCard
    demo programs:
    use proper indentations

    can someone simplify the following code so that it works with my instructions? I had a friend (took this class before) help with the coding but he didnt have to use class deck.
    import java.awt.*;
    import java.applet.*;
    import java.awt.event.*;
    import java.lang.Character.Subset;
    public class Blackjack extends Applet implements ActionListener {
    String suit[] = {"H","C","D","S"};
    String cardvalue[] = {"A","2","3","4","5","6","7","8","9","10","J","Q","K" };
    int deck[] = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,0};
    Font suitfont = new Font("SansSerif",Font.BOLD,24);
    Font cardfont = new Font("Arial",Font.BOLD,24);     
    Font bigfont = new Font("Arial",Font.BOLD,36);     
    private Button hit = new Button(" Hit Me ");
    private Button stand = new Button(" Stand ");
    private Button deal = new Button(" Deal ");
    int clearscreen = 1;
    int card = 0;
    int housewins = 0;
    int playerwins = 0;
    int housepoints = 0;
    int playerpoints = 0;
    int housecards = 2;
    int playercards = 2;
    int turn = 0;
         public void init() {          
              add(hit);
         hit.addActionListener(this);
         add(stand);
         stand.addActionListener(this);     
         add(deal);
         deal.addActionListener(this);
         shuffle();
         card = 0;
         public void shuffle() {
         for(int i=0;i<1000;++i)
              int a = (int)(Math.random()*52.0);
              int b = (int)(Math.random()*52.0);
              int temp = deck[a];
              deck[a] = deck;
              deck[b] = temp;
         public void paint(Graphics g) {
    Image temp1 = getImage(getDocumentBase(),"s1.gif");
    Image temp2 = getImage(getDocumentBase(),"s2.gif");
    Image temp3 = getImage(getDocumentBase(),"s3.gif");
    Image temp4 = getImage(getDocumentBase(),"s4.gif");
    Image[] thesuit = {temp1, temp2, temp3, temp4};
              /* if(clearscreen==1) {
              g.fillRect(0,0,500,350);
              clearscreen = 0;
              setBackground(Color.green);
              g.setFont(bigfont);
              g.setColor(Color.blue);
              g.drawString("House", 50, 80 );
              g.drawString("Player", 50, 200 );
              g.drawString("Wins",370, 80);          
              g.drawString(Integer.toString(housewins),400,170);
              g.drawString(Integer.toString(playerwins),400,290);
              g.setFont(suitfont);
              if(((deck[card + 1] / 13) == 3) || ((deck[card + 1] / 13) == 2))
                   g.setColor(Color.red);
              else
                   g.setColor(Color.black);     
              g.drawString(cardvalue[deck[card + 1] % 13] , 100 , 120 );
              g.drawImage(thesuit[deck[card + 1] / 13] ,130, 100 ,this);
              if(((deck[card + 2] / 13) == 3) || ((deck[card + 2] / 13) == 2))
                   g.setColor(Color.red);
              else
                   g.setColor(Color.black);     
              g.drawString(cardvalue[deck[card + 2] % 13] , 20 , 240 );
              g.drawImage(thesuit[deck[card + 2] / 13] ,50, 220 ,this);
              if(((deck[card + 3] / 13) == 3) || ((deck[card + 3] / 13) == 2))
                   g.setColor(Color.red);
              else
                   g.setColor(Color.black);     
              g.drawString(cardvalue[deck[card + 3] % 13] , 100 , 240 );
              g.drawImage(thesuit[deck[card + 3] / 13] ,130, 220 ,this);          
    if (playercards>2) {
    if(((deck[card + 4] / 13) == 3) || ((deck[card + 4] / 13) == 2))
                   g.setColor(Color.red);
              else
                   g.setColor(Color.black);     
              g.drawString(cardvalue[deck[card + 4] % 13] , 180 , 240 );
              g.drawImage(thesuit[deck[card + 4] / 13] ,210, 220 ,this);               
    if (playercards>3) {
    if(((deck[card + 5] / 13) == 3) || ((deck[card + 5] / 13) == 2))
                   g.setColor(Color.red);
              else
                   g.setColor(Color.black);     
              g.drawString(cardvalue[deck[card + 5] % 13] , 260 , 240 );
              g.drawImage(thesuit[deck[card + 5] / 13] ,290, 220 ,this);               
    if (playercards>4) {
    if(((deck[card + 6] / 13) == 3) || ((deck[card + 6] / 13) == 2))
                   g.setColor(Color.red);
              else
                   g.setColor(Color.black);     
              g.drawString(cardvalue[deck[card + 6] % 13] , 340 , 240 );
              g.drawImage(thesuit[deck[card + 6] / 13] ,370, 220 ,this);               
    if (housecards>2) {
    if(((deck[card +  playercards + 2] / 13) == 3) || ((deck[card + playercards + 2] / 13) == 2))
                   g.setColor(Color.red);
              else
                   g.setColor(Color.black);     
              g.drawString(cardvalue[deck[card + playercards + 2] % 13] , 180 , 120 );
              g.drawImage(thesuit[deck[card + playercards + 2] / 13] ,210, 100 ,this);               
    if (housecards>3) {
    if(((deck[card + playercards + 3] / 13) == 3) || ((deck[card + playercards + 3] / 13) == 2))
                   g.setColor(Color.red);
              else
                   g.setColor(Color.black);     
              g.drawString(cardvalue[deck[card + playercards + 3] % 13] , 260 , 120 );
              g.drawImage(thesuit[deck[card + playercards + 3] / 13] ,290, 100 ,this);               
    if (housecards>4) {
    if(((deck[card + playercards + 4] / 13) == 3) || ((deck[card + playercards + 4] / 13) == 2))
                   g.setColor(Color.red);
              else
                   g.setColor(Color.black);     
              g.drawString(cardvalue[deck[card + playercards + 4] % 13] , 340 , 120 );
              g.drawImage(thesuit[deck[card + playercards + 4] / 13] ,370, 100 ,this);               
              g.setColor(Color.red);
              g.drawString("Your Points: " , 20, 290 );
              g.drawString("House Points: " , 20, 160 );     
              playerpoints = 0;
              int wasace = 0;
              for(int i=2;i<(playercards+2);++i)
                   int cardvalue = 1 + deck[card +  i] % 13;
                   if(cardvalue < 11)
                        playerpoints = playerpoints + cardvalue;
                   if(cardvalue > 10)
                        playerpoints = playerpoints + 10;
                   if((cardvalue == 1) && (playerpoints < 12))
                   {  wasace=1;
                        playerpoints = playerpoints + 10;
              if((wasace==1)&&(playerpoints>21))
                   playerpoints = playerpoints - 10;
              if(playerpoints>21) {
              turn=1;
              g.drawString("Bust" , 320, 290 );
              if((playerpoints==21)&&(playercards==2)) {
              turn=1;
              g.drawString("BlackJack" , 240, 290 );
              if(turn==0)
              g.drawString("? ?" , 20 , 120 );
              else
              if(((deck[card] / 13) == 3) || ((deck[card] / 13) == 2))
                   g.setColor(Color.red);
              else
                   g.setColor(Color.black);     
              g.drawString(cardvalue[deck[card ] % 13] , 20 , 120 );
              g.drawImage(thesuit[deck[card ] / 13] , 50, 100 ,this);
              housepoints = 0;
              wasace=0;
              for(int i=0;i<2;++i)
                   int cardvalue = 1 + deck[card +  i] % 13;
                   if(cardvalue < 11)
                        housepoints = housepoints + cardvalue;
                   if(cardvalue > 10)
                        housepoints = housepoints + 10;
                   if((cardvalue == 1) && (playerpoints < 12))
                   { wasace=1;
                        housepoints = housepoints + 10;}
              for(int i=2;i<housecards;++i)
                   int cardvalue = 1 + deck[card +  i + playercards] % 13;
                   if(cardvalue < 11)
                        housepoints = housepoints + cardvalue;
                   if(cardvalue > 10)
                        housepoints = housepoints + 10;
                   if((cardvalue == 1) && (housepoints < 12)) {
                        wasace=1;
                        housepoints = housepoints + 10;}
              if((wasace==1)&&(housepoints>21))
                   housepoints = housepoints - 10;
              if((housepoints<16) && (turn==1) &&(playerpoints<22)&& (!((playerpoints==21)&&(playercards==2))))
                   ++housecards;
                   repaint();
              g.drawString(Integer.toString(playerpoints) , 190,290 );     
              if(turn==1)
                   g.drawString(Integer.toString(housepoints) , 190,160 );     
              if(housepoints>21)           
              g.drawString("Bust" , 320, 160 );
    public void actionPerformed(ActionEvent e)
              if(e.getSource() == hit) {
                   if((turn==0)&&(playercards<5))
                   ++playercards;
                   repaint();
              if(e.getSource() == stand) {
                   if(playerpoints>13)
                   turn = 1;
                   repaint();
              if(e.getSource() == deal) {
                        card = card + playercards + housecards;
                        if(card>40)
                             shuffle();
                             card=0;
                   if(((playercards==2)&&(playerpoints==21))||(playerpoints>housepoints)||((playerpoints<22)&&(playercards==5)))
                        ++playerwins;
                   else
                        ++housewins;
                   playercards = 2;
                   housecards = 2;
                   turn = 0;
                   repaint();

Maybe you are looking for