Javacing code in terminal havivng a Jar in CLASSPATH

Posted by Masi on Super User See other posts from Super User or by Masi
Published on 2010-03-30T21:43:29Z Indexed on 2010/03/30 21:53 UTC
Read the original article Hit count: 393

How can you javac the code in terminal by using google-collections in CLASSPATH?

Example of code trying to javac in terminal (works in Eclipse)

import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
public class Locate {
   ...
   BiMap<MyFile, Integer> rankingToResult = HashBiMap.create();
   ...
}

Javacing in terminaling

src 288 % javac Locate.java 
Locate.java:14: package com.google.common.collect does not exist
import com.google.common.collect.BiMap;
                                ^
Locate.java:15: package com.google.common.collect does not exist
import com.google.common.collect.HashBiMap;
                                ^
Locate.java:153: cannot find symbol
symbol  : class BiMap
location: class Locate
        BiMap<MyFile, Integer> rankingToResult = HashBiMap.create();
        ^
Locate.java:153: cannot find symbol
symbol  : variable HashBiMap
location: class Locate
        BiMap<MyFile, Integer> rankingToResult = HashBiMap.create();
                                                 ^
4 errors

My CLASSPATH

src 289 % echo $CLASSPATH 
/u/1/bin/javaLibraries/google-collect-1.0.jar

© Super User or respective owner

Related posts about java

Related posts about ubuntu