K
K
Karina2015-06-21 19:49:14
Java
Karina, 2015-06-21 19:49:14

How to get rid of Could not find or load main class StdIn error?

There is a class StdIn (it has a main method).
If I do this:
javac StdIn.java
and then:
java StdIn
then everything works fine for me.
But I definitely need to use this class in another class and in another folder.
Therefore, I need to register a package in the StdIn class. I make a package and copy the name of the folder in which this class is located and I get an error that is in the title.
How to avoid it?
Thanks everyone for the replies.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Emin, 2015-06-21
@iKapex

javac codefrombook/StdIn.java
java codefrombook.StdIn
stackoverflow.com/questions/18093928/what-does-cou...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question