This question already has answers here:
How can a program control another program?
(11 answers)
Closed 8 years ago.
I wonder is possible to make a bot writen in JAVA, which will open some program(program is under windows), click on the button in this program and type some data, check status of this program(login or logout, this is client for online game).
Which JAVA tools I need ? I think that java robot lib is not enough for this.
Thanks in advance.
You cannot do this using JAVA.
JAVA is a language which is loosely coupled with operating systems, so it can only receive mouse/key messages from underlying OS. Among all the tasks you mentioned , it can only start the program by using Runtime.execute.
If you want to implement a software like this ,you should use Visual Studio and use Microsoft technologies.
Related
This question already has answers here:
Calling Python in Java?
(12 answers)
Closed 3 years ago.
I'm trying to build an OCR desktop application using Java and, to do this, I have to use libraries and functions that were created using the Python programming language, so I want to figure out: how can I use those libraries inside my Java application?
I have already seen Jython, but it is only useful for cases when you want to run Java code in Python; what I want is the other way around (using Python code in Java applications).
I have worked in projects where Python was used for ML (machine learning) tasks and everything else was written in Java.
We separated the execution environments entirely. Instead of mixing Python and Java in some esoteric way, you create independent services (one for Python, one for Java), and then handle inter-process communication via HTTP or messaging or some other mechanism. "Mircoservices" if you will.
This question already has answers here:
Global keylogger in Java
(3 answers)
Closed 6 years ago.
I have been searching for a while now for a library that allows me to know which Key-Event was pressed. But not in a focused program/text-field or anything else but as a process that runs in the background.
I'm not trying to write a keylogger but I want to create a program that lets me create shortcuts for key-combinations.
I don't think Java has native support for something like this. Java is really a language of abstraction, it gets you further away from the OS to make developing easier - but also for security purposes.
Key events are core to the OS so you will (likely) need a language or a library has that capability. Check out JNativeHook.
You can achieve this using JNI and Global System hook. Global System hook applies a Key Logger to the whole computer and not the JVM therefore allowing you to capture key presses outside of the JVM.
An example implementation of it can be seen here
This question already has answers here:
How Do I Eject a Volume in Java?
(2 answers)
Closed 3 years ago.
I know that questions like this have been asked before, but I couldn't find any more recent ones and I have a twist to my question.
I've developed an application in Java that is designed to run on removable media, and work on both Windows and Mac. I would like to add a button to safely remove/eject the device, if it is supported (i.e a USB drive). Is there a command line for each operating system that would allow me to do this?
I know that it can be done by an application running on the device to be ejected, because I've seen one that does it, but obviously I understand there are certain limitations to Java.
Thanks in advance
This is something that you will have to do by invoking an auxiliary application. These applications are not platform independent as you wish. So, to do that, find out which OS you are on by using System.getProperty("os.name") and invoke the appropriate command for the detected OS. Invoking applications is done with Runtime.getRuntime().exec(). Search for the commands you need for each OS.
This question already exists:
Can I use a api written in C with java web service [duplicate]
Closed 9 years ago.
I have a tool kit which is written in C. I want to make a java web service which will use this toolkit. how can I do that. how can I call the functions of this toolkit
If the toolkit gives outputs, can you just take the outputs and pipe them?
If not, I think it'd just be easier to convert it yourself, unless pointers are involved.
Otherwise,
http://java.sun.com/docs/books/jni/html/start.html#769
This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
How can I convert OO Perl to Java?
Hello.
I have a perl script and I want to translate it to Java.
Is there any translator/conversor from perl script to Java?
By the way, I'm developing an Android 2.2 application.
EDIT
I have closed the question. Stop downvoting me!!!!!! And if you downvote tell us why!!
Thanks.
You should consider using the Android Scripting Environment so that you can just use your Perl script rather than having to "translate" it to Java (especially if you plan on relying on some translation tool to do it).
It supports Perl, along with Python, Ruby, and some others.
Just my two cents...
I would convert the Perl to Java by hand that way you are 100% in control of the Java code running in your Android application and that way you will understand what the Perl code is actually doing rather than relying on it to work when there is a bug in your Android app.
No. There's the JPL project from the 90's that might've been a workaround, but I'm pretty sure it fell apart along the road.