2

I have a folder that has one java source (.java) and one java (.class) class file. I try to get the autocomplete functionality of bash by pressing <tab> after the

java

or

java MyCl

in order for bash to auto fill the filename MyClass .

Nothing happens though...

INFO:

My java file is located in

which java
/home/username/Programs/jdk1.8.0_40/bin/java

and

whereis java
java: /usr/bin/java /usr/bin/X11/java /usr/share/java /usr/share/man/man1/java.1.gz
2
  • Are you sure you're in the same directory as the MyClass.java/MyClass.class file? Just asking the stupid question because you'd be surprised how often stupid things cause problems. Oct 28, 2015 at 19:44
  • Absolutely sure !
    – pgmank
    Oct 28, 2015 at 19:46

1 Answer 1

0

set your CLASSPATH variable to include the current directory. For example, in your ~/.bashrc (or ~/.profile) add this line:

    export CLASSPATH=.:$CLASSPATH

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .