1

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
  • 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. – RPiAwesomeness Oct 28 '15 at 19:44
  • Absolutely sure ! – pgmank Oct 28 '15 at 19:46
0

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

    export CLASSPATH=.:$CLASSPATH

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.