Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Google Cloud Api(Problem with the Google Cloud Api)
Google Cloud Api [message #1792948] Thu, 26 July 2018 10:37 Go to next message
Mino Napoletano is currently offline Mino NapoletanoFriend
Messages: 2
Registered: July 2018
Junior Member
I am trying to import some Google Cloud Speech apis (listed below) into a java web application in Eclipse, but I get the error "the import cannot be resolved".
However, if I do the same imports into a normal java project, all of them are recognized, as you can see from the pictures attached. Unfortunately, I need to use them in a web application, can I do that?

My Eclipse Version is Oxygen.3a Release (4.7.3a) and the imports are the following:

import com.google.cloud.speech.v1p1beta1.RecognitionAudio;
import com.google.cloud.speech.v1p1beta1.RecognitionConfig;
import com.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding;
import com.google.cloud.speech.v1p1beta1.RecognizeResponse;
import com.google.cloud.speech.v1p1beta1.SpeechClient;
import com.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative;
import com.google.cloud.speech.v1p1beta1.SpeechRecognitionResult;

Thanks a lot for the help.
  • Attachment: java_project.jpg
    (Size: 179.81KB, Downloaded 142 times)
  • Attachment: jsp.jpg
    (Size: 174.99KB, Downloaded 133 times)
Re: Google Cloud Api [message #1792980 is a reply to message #1792948] Thu, 26 July 2018 20:56 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

For one, you can't declare a class within a scriptlet that way, it would have to be within a declaration. Moreover, are
the same API jars are also in the web project's Java Build Path (ideally in its WEB-INF/lib folder)? Every project
is separate.


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: Google Cloud Api [message #1792990 is a reply to message #1792980] Fri, 27 July 2018 07:20 Go to previous messageGo to next message
Mino Napoletano is currently offline Mino NapoletanoFriend
Messages: 2
Registered: July 2018
Junior Member
Thanks for the reply.
I did not copy the libs under WEB_INF, just in the build path, but I just did that and still cannot resolve the imports.
Re: Google Cloud Api [message #1793028 is a reply to message #1792990] Fri, 27 July 2018 23:32 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

They'd have to be in WEB-INF/lib specifically, but you might need to clean and build the project or otherwise force revalidation.

_
Nitin Dahyabhai
Eclipse Web Tools Platform
Previous Topic:eclipse Gprof timing not shows
Next Topic:Libraries for new install of C++
Goto Forum:
  


Current Time: Fri Apr 26 04:01:36 GMT 2024

Powered by FUDForum. Page generated in 0.05436 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top