i think string isempty is new in jdk which means this will not compile on jdk you might need to do libjavapackages length instead or alternatively  just replace the above logic with string libjavapackages null when adding if  libjavapackages null libjavapackages libjavapackage else libjavapackages libjavapackages then there is no need to null it back out  and besides you only end up with between the paths instead of having a useless one at the end 