Extreme beginer

Discussion in 'Java' started by K, Oct 11, 2012.

  1. K

    K Guest

    This is what I have in eclipse and when I run the program in regular and debug mode nothing seems to work only some code stuff appears at the bottom of the screen in some pane and I don't know why because in the book i'm reading thats not what happens


    public class Class2 {

    /**
    * @param args
    */
    public static void main(String[] args) {
    // TODO Auto-generated method stub
    System.out.println("hello");
    }

    }
     
    K, Oct 11, 2012
    #1
    1. Advertising

  2. K

    markspace Guest

    On 10/10/2012 8:10 PM, K wrote:
    > This is what I have in eclipse and when I run the program in regular
    > and debug mode nothing seems to work only some code stuff appears at
    > the bottom of the screen in some pane and I don't know why because in
    > the book i'm reading thats not what happens
    >



    That "code stuff" might be important, dontcha think? Copy and paste it
    here, exactly as it appears. Getting the details exactly correct are
    important, otherwise we can't help you.

    When I tried this just now, I saw the string "hello" appear on the
    Console tab. Make sure you're looking at that one. When I deliberately
    introduced an error, the errors also appeared in the Console tab.


    >
    > public class Class2 {
    >
    > /**
    > * @param args
    > */
    > public static void main(String[] args) {
    > // TODO Auto-generated method stub
    > System.out.println("hello");
    > }
    >
    > }
    >
     
    markspace, Oct 11, 2012
    #2
    1. Advertising

  3. K

    Lew Guest

    markspace wrote:
    > K wrote:
    >> This is what I have in eclipse and when I run the program in regular
    >> and debug mode nothing seems to work only some code stuff appears at
    >> the bottom of the screen in some pane and I don't know why because in
    >> the book i'm reading thats not what happens

    >
    > That "code stuff" might be important, dontcha think? Copy and paste it


    That is, do not paraphrase it.

    > here, exactly as it appears. Getting the details exactly correct are
    > important, otherwise we can't help you.


    It's likely that the error messages you saw contain the answers you seek.

    > When I tried this just now, I saw the string "hello" appear on the
    > Console tab. Make sure you're looking at that one. When I deliberately
    > introduced an error, the errors also appeared in the Console tab.


    I am betting you didn't invoke the compiler or runtime correctly, K.

    --
    Lew
     
    Lew, Oct 11, 2012
    #3
  4. K

    K Guest

    this is what appeared at the bottom of the screen in the console tab


    Usage: javaw [-options] class [args...]
    (to execute a class)
    or javaw [-options] -jar jarfile [args...]
    (to execute a jar file)

    where options include:
    -server to select the "server" VM
    -hotspot is a synonym for the "server" VM [deprecated]
    The default VM is server.

    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
    A ; separated list of directories, JAR archives,
    and ZIP archives to search for class files.
    -D<name>=<value>
    set a system property
    -verbose[:class|gc|jni]
    enable verbose output
    -version print product version and exit
    -version:<value>
    require the specified version to run
    -showversion print product version and continue
    -jre-restrict-search | -jre-no-restrict-search
    include/exclude user private JREs in the version search
    -? -help print this help message
    -X print help on non-standard options
    -ea[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
    enable assertions
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
    disable assertions
    -esa | -enablesystemassertions
    enable system assertions
    -dsa | -disablesystemassertions
    disable system assertions
    -agentlib:<libname>[=<options>]
    load native agent library <libname>, e.g. -agentlib:hprof
    see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
    load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
    load Java programming language agent, see java.lang.instrument
    -splash:<imagepath>
    show splash screen with specified image
     
    K, Oct 13, 2012
    #4
  5. K

    K Guest

    On Thursday, October 11, 2012 12:07:04 AM UTC-7, Lew wrote:
    > markspace wrote:
    >
    > > K wrote:

    >
    > >> This is what I have in eclipse and when I run the program in regular

    >
    > >> and debug mode nothing seems to work only some code stuff appears at

    >
    > >> the bottom of the screen in some pane and I don't know why because in

    >
    > >> the book i'm reading thats not what happens

    >
    > >

    >
    > > That "code stuff" might be important, dontcha think? Copy and paste it

    >
    >
    >
    > That is, do not paraphrase it.
    >
    >
    >
    > > here, exactly as it appears. Getting the details exactly correct are

    >
    > > important, otherwise we can't help you.

    >
    >
    >
    > It's likely that the error messages you saw contain the answers you seek.
    >
    >
    >
    > > When I tried this just now, I saw the string "hello" appear on the

    >
    > > Console tab. Make sure you're looking at that one. When I deliberately

    >
    > > introduced an error, the errors also appeared in the Console tab.

    >
    >
    >
    > I am betting you didn't invoke the compiler or runtime correctly, K.
    >
    >
    >
    > --
    >
    > Lew


    Usage: javaw [-options] class [args...]
    (to execute a class)
    or javaw [-options] -jar jarfile [args...]
    (to execute a jar file)

    where options include:
    -server to select the "server" VM
    -hotspot is a synonym for the "server" VM [deprecated]
    The default VM is server.

    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
    A ; separated list of directories, JAR archives,
    and ZIP archives to search for class files.
    -D<name>=<value>
    set a system property
    -verbose[:class|gc|jni]
    enable verbose output
    -version print product version and exit
    -version:<value>
    require the specified version to run
    -showversion print product version and continue
    -jre-restrict-search | -jre-no-restrict-search
    include/exclude user private JREs in the version search
    -? -help print this help message
    -X print help on non-standard options
    -ea[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
    enable assertions
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
    disable assertions
    -esa | -enablesystemassertions
    enable system assertions
    -dsa | -disablesystemassertions
    disable system assertions
    -agentlib:<libname>[=<options>]
    load native agent library <libname>, e.g. -agentlib:hprof
    see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
    load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
    load Java programming language agent, see java.lang.instrument
    -splash:<imagepath>
    show splash screen with specified image
     
    K, Oct 13, 2012
    #5
  6. K

    Lew Guest

    K wrote:
    > this is what appeared at the bottom of the screen in the console tab
    >
    > Usage: javaw [-options] class [args...]
    > (to execute a class)
    > or javaw [-options] -jar jarfile [args...]
    > (to execute a jar file)
    > [etc.]


    and is that how you used it?

    --
    Lew
     
    Lew, Oct 13, 2012
    #6
  7. K

    markspace Guest

    On 10/12/2012 7:36 PM, K wrote:
    > this is what appeared at the bottom of the screen in the console tab
    >
    > Usage: javaw [-options] class [args...]


    [snip]


    If this is appear on an Eclipse screen, then something is very wrong.
    I'd uninstall and reinstall. I'd also check your project type to make
    certain you created the right type of project, and double check the
    location of your source file to make sure you didn't put it inside the
    build script or the META-INF directory or something.

    The Eclipse forums could probably help you better, I have no deep
    knowledge of Eclipse that would allow me to debug a problem like this.

    <http://www.eclipse.org/forums/>
     
    markspace, Oct 13, 2012
    #7
  8. K

    markspace Guest

    On 10/13/2012 8:54 AM, markspace wrote:

    > The Eclipse forums could probably help you better, I have no deep
    > knowledge of Eclipse that would allow me to debug a problem like this.
    >
    > <http://www.eclipse.org/forums/>



    P.S. I assume this is your thread here?

    <http://www.eclipse.org/forums/index.php/m/740799/>

    I see they couldn't come up with anything either. If the re-install
    doesn't do it, I think you should double check the location and type of
    the JDK.

    Open a regular Windows command console and type "java -version" and copy
    the text output. (There's a menu in the upper left corner that allows
    you to mark an area of the screen for copying, then copy to the
    clipboard by pressing Enter.)

    Show us that, your path (output of the PATH command), and then CD to the
    directory that your JDK is in and do a DIR of the /bin directory too,
    show us the result of that. I have no idea if this will help, but
    screwy symptoms call for screwy solutions.
     
    markspace, Oct 13, 2012
    #8
  9. K

    K Guest

    On Friday, October 12, 2012 10:37:29 PM UTC-7, Lew wrote:
    > K wrote:
    >
    > > this is what appeared at the bottom of the screen in the console tab

    >
    > >

    >
    > > Usage: javaw [-options] class [args...]

    >
    > > (to execute a class)

    >
    > > or javaw [-options] -jar jarfile [args...]

    >
    > > (to execute a jar file)

    >
    > > [etc.]

    >
    >
    >
    > and is that how you used it?
    >
    >
    >
    > --
    >
    > Lew


    what do you mean? Plus where is the java compiler I can't find it
     
    K, Oct 13, 2012
    #9
  10. K

    markspace Guest

    On 10/13/2012 12:18 PM, K wrote:

    > what do you mean? Plus where is the java compiler I can't find it


    javac (The Java compiler) should be on your path. It should install in
    one of the Java directories in /Program Files of one stripe or another,
    if you're on Windows.

    Take a look there for it.
     
    markspace, Oct 13, 2012
    #10
  11. K

    Lew Guest

    K wrote:
    > what do you mean? Plus where is the java [sic] compiler I can't find it


    You're asking us? Where did you put it?

    What Java version are you using? How did you install it? Where did you
    install it?

    Do you know how to use a computer to find files on your hard drive?

    --
    Lew
     
    Lew, Oct 13, 2012
    #11
  12. K

    K Guest

    On Saturday, October 13, 2012 12:44:25 PM UTC-7, markspace wrote:
    > On 10/13/2012 12:18 PM, K wrote:
    >
    >
    >
    > > what do you mean? Plus where is the java compiler I can't find it

    >
    >
    >
    > javac (The Java compiler) should be on your path. It should install in
    >
    > one of the Java directories in /Program Files of one stripe or another,
    >
    > if you're on Windows.
    >
    >
    >
    > Take a look there for it.


    I feel really stupid now because I just ran as java application and it worked but thanks for all the help you gave me
     
    K, Oct 13, 2012
    #12
  13. K

    K Guest

    On Saturday, October 13, 2012 1:09:42 PM UTC-7, Lew wrote:
    > K wrote:
    >
    > > what do you mean? Plus where is the java [sic] compiler I can't find it

    >
    >
    >
    > You're asking us? Where did you put it?
    >
    >
    >
    > What Java version are you using? How did you install it? Where did you
    >
    > install it?
    >
    >
    >
    > Do you know how to use a computer to find files on your hard drive?
    >
    >
    >
    > --
    >
    > Lew



    I feel really stupid now because I just ran as java application and it worked but thanks for all the help you gave me
     
    K, Oct 13, 2012
    #13
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. My and I

    Beginer need helppp!!

    My and I, Aug 24, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    487
    clintonG
    Aug 24, 2004
  2. Lloyd Dupont

    dummy beginer's question

    Lloyd Dupont, Nov 20, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    441
    clintonG
    Nov 21, 2005
  3. ArMa

    Beginer question

    ArMa, Apr 13, 2005, in forum: Java
    Replies:
    0
    Views:
    481
  4. Darko Lapanje

    beginer

    Darko Lapanje, Sep 9, 2003, in forum: C++
    Replies:
    3
    Views:
    446
    Stuart Golodetz
    Sep 9, 2003
  5. karthikbalaguru
    Replies:
    9
    Views:
    665
    JosephKK
    Mar 22, 2009
Loading...

Share This Page