V
V
vaselekk2020-11-24 22:15:40
Java
vaselekk, 2020-11-24 22:15:40

How to create in java?

Folks, I have 3 questions.

1) how to create a function in java that will be called every second.
2) how to send a request from java to a file to the server. and get the content of the file
3) when I created the program and want to run it on a 32 bit computer, how can I do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan, 2020-11-24
@vaselekk

Hello!

1) how to create a function in java that will be called every second.

It's not entirely clear what exactly you want to do? If you want to schedule the execution of a specific script, then you can, for example, use CRON (if on a linux server), i.e. the scheduler will run your script every second. Are we talking about this? If not, then you can, for example, create a loop inside the application so that it does not close, and then use various libraries or even the ScheduledExecutorService from the java.concurrent package to work with schedule.
Here is a list of useful links:
https://dzone.com/articles/schedulers-in-java-and-...
https://stackoverflow.com/questions/7814089/how-to...
https://leventov .medium.com/cronscheduler-a-reliab...
2) how to send a request from java to a file to the server. and get file content

Here, here https://www.baeldung.com/java-download-file there are clear examples of how this can be done. Everything is spelled out as well as possible. It is possible to use third-party libraries and default classes.
3) when I have created a program and want to run it on a 32 bit computer, how can I do it?

You need to install jre for 32 bit and run your application there.
https://www.oracle.com/java/technologies/javase-jr...
https://www.oracle.com/java/technologies/install-w...
For spring applications - https://habr. com/ru/post/193140/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question