Java Pet Peeve

I'm guessing there's got to be a very good reason for this, but I can't see it. Perhaps somebody can enlighten me. I'm thinking of something here that can help novice Java users.

Hand's up all the people who, when they were first starting with Java, accidentally typed something like:

  % java SomeApp.class

when they really should have been trying to run:

  % java SomeApp

You got back an error message like:

Exception in thread "main" java.lang.NoClassDefFoundError: SomeApp/class

Now experienced Java users realise soon realise what's going on here and adjust accordingly. But what about helping novice Java users?

With just a little more effort the java program could check to see if there was a SomeApp.class file in the currently directory and then check if it was a valid class file and if so, it could return an error message like:

Exception in thread "main" java.lang.NoClassDefFoundError: SomeApp/class

Did you really mean "java SomeApp" ?

or something similar. I'd leave it to HCI people, or a flock of senior engineers or lawyers to properly define the wording.

What am I missing?

Update: After receiving some private email on this, I've filed CR #6222504 on this issue. If you are interested get yourself added to that bug's interest list.

[]

Comments:

Post a Comment:
Comments are closed for this entry.
About

user12607856

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today