I created one java class which is connected to the online DB. I want to use my java code in Linux. But I want that code run continuously in the Linux system in a background. Or else how to use a wrapper class?
Asked
Active
Viewed 24 times
-2
-
Your question is not very detailed. Please give us some more detail. – Mijago Oct 01 '16 at 06:40
-
Can you be more specific? – Oct 01 '16 at 06:45
-
Java is platform independent, all you need is a JRE installed on the system. As for the rest of your question it's not very clear what you're trying to ask. I don't see the connection between running a program in the background and using a wrapper class, can you clarify what you're asking? – D.B. Oct 01 '16 at 06:49
-
Possible duplicate of [Run automatically program on startup under linux ubuntu](http://stackoverflow.com/q/7221757/5221149), which itself is a duplicate of [Linux equivalent for Windows Startup](http://unix.stackexchange.com/q/19634) on http://unix.stackexchange.com/. – Andreas Oct 01 '16 at 07:23
1 Answers
0
Java is Plattform independend as long as you dont use any os-related libraries. As there are JDBC drivers for Unix and windows, this should not make a problem.
But remember to install the JRE (Java Runtime Environment) with the same version you created the application for.
You can pack it into a jar and call it with
java -jar <path>
You can run it in the background in different ways like forking it or creating a second terminal, use screen and call the java command.

Mijago
- 1,569
- 15
- 18