Extreme beginer

K

K

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

}
 
M

markspace

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

}
 
L

Lew

markspace said:
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.
 
K

K

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

K

That is, do not paraphrase it.







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








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

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
 
L

Lew

K said:
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?
 
M

markspace

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/>
 
M

markspace

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.
 
M

markspace

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.
 
L

Lew

K said:
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?
 
K

K

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

K

K said:
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?


I feel really stupid now because I just ran as java application and it worked but thanks for all the help you gave me
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top