Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Why would you run it as root? The java-runtime tries to load the class Ex1_1 in the package home.myname.Documents. Change directory into Documents and do it from there. cd /home/myname/Documents, then javac Ex1_1.java and java Ex1_1

Why would you run it as root? Don't do that.

The java-runtime tries to load the class Ex1_1 in the package home.myname.Documents. Change home.myname.Documents. To properly run it, change directory into Documents Documents and do it from there. cd /home/myname/Documents, then

javac Ex1_1.java and to compile and

java Ex1_1 to run

Or you can give the classpath to the Runtime with the -cp parameter:

javac /home/username/documents/Ex1_1.java
java -cp /home/username/documents Ex1_1

Note the space in the last line between the path where the class is, and the class which is to run.