Liping Huang
Liping Huang

Reputation: 4476

Is command javap not case-sensitive?

I created a very simple class Test.java

import java.util.*;

public class Test { 
    public static void main(String[] args) {
    String[] stringArr = new String[10];
        Object[] objs = stringArr;

        objs[0] = 1;

        System.out.println(objs[0]);
    }
}

so I can compile it by using javac Test, after that, I want to see the detail inside the Test class by using javap commond, but actually I made a mistake as below:

D:\>javap -private TEst
Compiled from "Test.java"  
public class Test extends java.lang.Object{    
public Test();
    public static void main(java.lang.String[]);
}

as you see, I typed TEst after the javap command, but actually the command show the information of the class, after that I tired to use javap -private TEST, it is also working.

is it means javap is not case-sensitive?

Note:
My JDK version is:

java version "1.6.0_43"
Java(TM) SE Runtime Environment (build 1.6.0_43-b01)
Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01, mixed mode)

Upvotes: 2

Views: 495

Answers (3)

Arpan Adhikari
Arpan Adhikari

Reputation: 127

I had got a similar error message when I tried to compile a program making slight case changes in the filename. I It turns out that @TheLostMind is correct.., thank you sir

Upvotes: 0

TheLostMind
TheLostMind

Reputation: 36304

"is it means javap is not case-sensitive?". This is not about javap.. its about the cmd prompt where you are using these commands.. The cmd prompt is case insensitive... you can do cd.. or CD.. or cD.. They all do the same thing..

Upvotes: 4

Elliott Frisch
Elliott Frisch

Reputation: 201439

The Windows file system is "case friendly"; it will try an insensitive search. The class name in the file is. Notice that javap Compiled from "Test.java"

Upvotes: 2

Related Questions