title: spark-shell error: value builder is not a member of object com.amazonaws.services.s3.model.PutObjectRequest
body: <p>I'm just getting started with EMR Hadoop/spark etc., I am trying to use spark-shell to run a scala code to upload a file to EMRFS S3 location however I am receiving below error -</p>
  <p>Without any Import If I run =&gt;</p>
  <pre><code>val bucketName = &quot;bucket&quot;
  val outputPath = &quot;test.txt&quot;
  
  scala&gt; val putRequest = PutObjectRequest.builder.bucket(bucketName).key(outputPath).build()
  &lt;console&gt;:27: error: not found: value PutObjectRequest
     val putRequest = PutObjectRequest.builder.bucket(bucketName).key(outputPath).build()
                      ^
  </code></pre>
  <p>Once I add the Import package for PutObjectRequest I still get a different error.</p>
  <pre><code>scala&gt; import com.amazonaws.services.s3.model.PutObjectRequest
  </code></pre>
  <p>import com.amazonaws.services.s3.model.PutObjectRequest</p>
  <pre><code>scala&gt; val putRequest = PutObjectRequest.builder.bucket(bucketName).key(outputPath).build()
  &lt;console&gt;:28: error: value builder is not a member of object com.amazonaws.services.s3.model.PutObjectRequest
     val putRequest = PutObjectRequest.builder.bucket(bucketName).key(outputPath).build()
                                       ^
  </code></pre>
  <p>I'm not sure what I am missing. Any help would be appreciated!</p>
  <p>Note: Spark version is 2.4.5</p>