mercredi 26 novembre 2014

What is the issue with my classpath? (Java)


Vote count:

0




I've been using NetBeans to do all the compilation/classpath work for me, but I wanna give it a go:


Below is what I was typing into command prompt. Can somebody point out why I java cannot find the class and how do I help it find the class?



C:\Users\Dziugas>set CLASSPATH=C:\Users\Dziugas\Desktop\Project\path;

C:\Users\Dziugas>cd desktop\Project\path

C:\Users\Dziugas\Desktop\Project\path>dir
Volume in drive C has no label.
Volume Serial Number is D89C-971F

Directory of C:\Users\Dziugas\Desktop\Project\path

26-Nov-14 11:27 <DIR> .
26-Nov-14 11:27 <DIR> ..
26-Nov-14 11:27 420 Path.class
26-Nov-14 11:25 161 Path.java
2 File(s) 581 bytes
2 Dir(s) 264,542,785,536 bytes free

C:\Users\Dziugas\Desktop\Project\path>java Path
Error: Could not find or load main class Path


I read in the oracle docs that my classpath should be set to the main package. My class is in a package called class:


Project | |--path | |-Path.class



asked 22 secs ago







What is the issue with my classpath? (Java)

Aucun commentaire:

Enregistrer un commentaire