I am a new dev in Bigquery. I am following tutorial in https://developers.google.com/bigquery/bigquery-api-quickstart with Java code and imported library from https://developers
You need to add the necessary .jar
files (separated by :
) to your classpath, i.e.
javac -cp path/to/jar1:path/to/jar2 <your_class.java>
java -cp path/to/jar1:path/to/jar2 <your_class>
alternatively you can add the .jar
files to the CLASSPATH
environment variable, i.e. (in unix systems)
export CLASSPATH=$CLASSPATH:/path/to/some.jar:/path/to/some/other.jar
This can change depending on your environment (i.e. if you are running these in a webapp server)
Are you using Maven and the BigQuery Java Client? It is recommended to use the Java client. If so, you can easily set it up by configuring your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigquery</artifactId>
<version>1.111.1</version>
</dependency>
More info on the BigQuery Java client: https://github.com/googleapis/java-bigquery
if you are using maven this is done easily with the following 2 dependence (you can changes the version to the latest one)
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-storage</artifactId>
<version>v1-rev12-1.19.0</version>
</dependency>
<dependency>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-bigquery</artifactId>
<version>v2-rev168-1.19.0</version>
</dependency>