You've got your error because of wrong syntax. Of course, java can't find Project class, there's no such thing declared. This is a correct declaration:
public class Project {
public static void main(String args[]) {
System.out.println(args[0]);
}
}
Note, that in Java class names start with upper-case letter, and access modifiers - with lower, like public, private, etc. I strongly suggest you to read Java Naming Conventions before writing any code.
If you're getting error like
couldn't find or load main class Project
there is a chance that the "current" directory is not in your classpath ( where java looks for .class definitions ), so you need to put in on the classpath with -cp
option (as it mentioned by @Nikhil B). Note, that doing
javac -classpath "c:\java\jdk1.7.0.45"\bin" Project.java
which you posted in comments to his answer isn't correct. You should tell java interpreter where to find .class files, not java compiler (+ as I see, you've compiled your .java file just fine).
So, put the directory which contains .class file to a classpath somehow like this:
[root@crmdev clarify]# pwd //shows current directory
/home/clarify
[root@crmdev clarify]# javac Project.java //compiles .java file
[root@crmdev clarify]# ls Project.* //here are my test files for your case
Project.class Project.java
[root@crmdev clarify]# java -cp . Project "hello, @user5779261" //executing test code
hello, @user5779261