I have a simple Hello World program that works properly when run from within Eclipse. What do I need to do to run this program from the command line?
~/g/private/eclipse/Hello/bin --> java Hello.class
Error: Could not find or load main class Hello.class
Here are the eclipse-generated files:
~/g/private/eclipse/Hello --> find . -type f
./.classpath
./.gitignore
./.project
./.settings/org.eclipse.jdt.core.prefs
./bin/Hello.class
./src/Hello.java
and the eclipse-generated .classpath
:
~/g/private/eclipse/Hello --> cat .classpath
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="output" path="bin"/>
</classpath>
(note) I don't think this is a dupe of this question, as I'm explicitly asking about running a program compiled in eclipse. How to run Java program in command prompt