r/java • • Sep 26 '15

Oracle's own Hello World code will not compile

Post image
312 Upvotes

42 comments sorted by

20

u/blast_plate_engel Sep 26 '15

Why won't it?

78

u/MyPhallicObject Sep 26 '15

public static void main (string [] args)

Should have been a capital S

52

u/_Sharp_ Sep 26 '15

Maybe is an example of multiplatform failure: "Try this and see how, no matter where you run it, you gonna get a red complain".

51

u/pretendscholar Sep 26 '15

Write once, fail everywhere

8

u/adisai1 Sep 26 '15

*Write once, test 300000 times, exceptions everywhere!

3

u/superPwnzorMegaMan Sep 26 '15

hard to run if it doesn't compile though.

12

u/lamperi- Sep 26 '15

Also the quotes don't look quite right

30

u/mgkimsal Sep 26 '15

Lovely "smart quotes" copied from MS Word no doubt. One of the best IDEs on the planet, apparently.

18

u/blu-red Sep 26 '15

probably why the string is lower case - because case was auto corrected to

6

u/potyl Sep 26 '15

You laugh but I remember writing a Corel WodPerfect macro and WordPerct was the "IDE". The nice things was that you could use rich text formatting for your own macro!

Is this comment important? Use bold! Is that function call puzzling you? Then set its background color in red!

1

u/mgkimsal Sep 26 '15

I used WordPerfect before Corel bought it, and did WordStar before that :)

Editors helping you create macros/etc editing in the program you're using are great! Using Wordperfect to create Excel macros would still be silly :)

EDIT: pretty sure they were initially independent, then corel bought them. I might have my dates mixed up, but I was using WordPerfect in... 1990? 1991? I don't remember the corel name until the late 90s.

3

u/Dashing_McHandsome Sep 26 '15

Bonus points if you remember Corel Linux

2

u/mgkimsal Sep 26 '15

Oh yeah! A friend installed it, but I was too into redhat to bother (later slackware on the servers, but only because that's what they pre-installed!)

And... Corel's WordPerfect for Java... whatever happened to that abomination? ;)

2

u/AStrangeStranger Sep 26 '15

It was bought by Novell in 1994 then Corel in 1996.

I recall writing a WordPerfect 5 Macro decompiler/compiler so I could edit the macros in something easier than WordPerfect's Macro Editor

1

u/DeGaulleSucksCock Feb 14 '16 edited Aug 21 '16

This comment has been overwritten by an open source script to protect this user's privacy. It was created to help protect users from doxing, stalking, harassment, and profiling for the purposes of censorship.

If you would also like to protect yourself, add the Chrome extension TamperMonkey, or the Firefox extension GreaseMonkey and add this open source script.

Then simply click on your username on Reddit, go to the comments tab, scroll down as far as possible (hint:use RES), and hit the new OVERWRITE button at the top.

1

u/ykechan Sep 29 '15

Maybe they got a class string in the same package.

154

u/__konrad Sep 26 '15

13

u/gliph Sep 26 '15

LOL

As a poster in /r/javahelp this sounds about right.

4

u/berlinbrown Sep 27 '15

Glad we have compilers so we can figure that shit out.

36

u/autra1 Sep 26 '15

Extension should be .java, not .png

19

u/conman16x Sep 26 '15

Not capitalizing your types. Rookie mistake.

2

u/caltheon Sep 27 '15

Biggest pain I have switching between c# and java

1

u/MantaArray Sep 27 '15

Can confirm: made this exact mistake as a rookie.

11

u/microferret Sep 26 '15

Not capitalising String? That's a paddling.

9

u/[deleted] Sep 27 '15

"string" as primitive type confirmed!

1

u/__konrad Sep 27 '15

It's alias to String like in C# ;)

10

u/pestario Sep 26 '15

Write once. Fail everywhere.

2

u/nonconvergent Sep 27 '15

What's with that space before the []?

3

u/TotesMessenger Sep 26 '15

I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:

If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / ^Contact)

-21

u/enry_straker Sep 26 '15
  • No public

  • String not string

7

u/NahroT Sep 26 '15

Actually making a class without public will still compile

5

u/takuhi Sep 26 '15

You don't need public, it'll use the "Default" package wide scope.

-6

u/berlinbrown Sep 26 '15

That is one random ass link. How did you get there?

Oracle has an infinite amount of documentation, they can't vet everything.

0

u/[deleted] Sep 26 '15

[deleted]

22

u/NewAnimal Sep 26 '15

is this a joke? everyone knows why it won't compile. except for people who don't know java .

4

u/microferret Sep 26 '15

It's pretty obvious why it won't compile. There's even a humorous picture in the top comment explaining why.

6

u/Bmitchem Sep 26 '15

Java is a bit of a headache that's true but it has some of the best multi-threading support of any of the "high level" languages and that gives it a fair amount of staying power.

3

u/[deleted] Sep 26 '15

That headache you refer to allows for easier maintenance and more explicit coding.

So the pain is sorta worth it at the enterprise level.

0

u/berlinbrown Sep 27 '15

This post is complete bullshit. It is a random post to an infinite supply of Java documentation and just happens to be wrong, won't compile. Regardless, the compiler will tell you that it won't compile and why.