Get Bars streaming without Python

OK I googled a lot. Can someone show me an example where we have used getBars in a streaming manner for 5 seconds bars (I don’t have live trading account, only paper trading).

I am not using Python. I found this example

def main():
stream = alpaca.StreamConn()
@stream.on(r’^AM’)
async def on_bars(conn, channel, data):
print(f’received bar {data}')
stream.run([‘AM.SPY’])

But this is using your python SDK. How can I stream the bars using Java/Scala at 5 seconds internal?

Sorry if this question is FAQ. I couldn’t find an answer and I did my fair share of googling before posting this.