I'm new to Java and practicing with the compiler on Ubuntu, i keep getting these error messages...

I'm new to Java and practicing with the compiler on Ubuntu, i keep getting these error messages, can someone tell me what I'm doing wrong?

Other urls found in this thread:

docs.oracle.com/javase/tutorial/getStarted/cupojava/unix.html
twitter.com/SFWRedditVideos

install gentoo

Maybe you should write println instead of print1n

>javac hello.java
>javac: file not found: hello.java
You should really figure out working directories and make one for your project.

>java /home/user/Documents/hello.java
>Error: Could not find or load main class
"java" starts the Java Virtual Machine, running a pre-compiled class, a JAR file or something like that. The file you gave it is not one of those.

>error: cannot find symbol
Did you really accidentally type "print1n" instead of "println" ?

Yes. You are illiterate.
And stupid because we have a thread for this shit

so it is supposed to be a lower case L then?
because when i tried that it works and creates the .class but i cant get it to execute

yes, ln is short for "line", as in "print line" (it prints the string followed by a new line)

Then you type
$ java hello
to execute, don't add the .class extension

...

after editing to println

you can type
cd Documents
to change the current directory from ~ (which is /home/user) to /home/user/Documents so you can just type
$ javac hello.java
$ java hello
without the full path.

Add the java PATH variable.

>can someone tell me what I'm doing wrong?

learning java

I'm sorry, the java path variable? I have not learned that much about java

java and javac are already on his PATH, his problem appears to simply be he is new to using the CLI and is unfamiliar with cd/how directories work.

Thought he figured it out before in when he realised he had to type javac /home/user/Documents/hello.java instead of just javac hello.java, but apparently that was a fluke because he's doing the same thing in PATH isn't the problem, but apparently Java named the .class filed with a capital H, so you need to type java Hello.

coming to java from perl sorry for the high levels of newfag

Jesus Christ, just install Eclipse.

the last part worked, so i need to use the java / javac command in that directory that it is written to avoid being this retarded again? or should i stop using sublime as a text editor and go back to nano

You can use whatever editor you want, you just need to practice with basic Linux CLI commands and learn what PATH is and how relative pathnames work.

so basicly learn linux system more and cli with some batch. I'll do that

nonetheless thank you for those who help i really appreciate it.

The Java Tutorials aren't that bad user, at least read this one article, it will help you:
docs.oracle.com/javase/tutorial/getStarted/cupojava/unix.html

perl mustard race!

This is some poo in loo tier here in this thread.
How is OP even able to breathe if he's that stupid

He's trying to learn shit instead of shitting in the street.
Could be a real rags to monkey containment cubicles story taking place here right now.

Java is such a horrendous fucking language, Jesus christ

>read a couple tutorials about perl for 10 minutes
>now I want to master java

System.out.print1n();

>nailed it

kek

try dr. java or bluebird to get the hang of things. might look embarrassing, but they really help gnubes.

lol OP has to be trolling as if he is having this much trouble he should seriously consider suicide

class name has to be same as file name. lowercase "h"

Made me laugh out loud.