How to let java applet download file - java

I am new to Java Applets.
I have the following situation: the client asks for a Java Applet to do Function1, i already have this Function1 developed and tested but in C#. so i say that i can use my C# dlls in Java applet.
I already tried to use UnmanagedExports and it works fine with simple cases, but i faced a problem when i have dependencies for the dll that is called from Java Applet. the problem is that Java Applet crashes when the dll have any dependencies and i did not find any solution for this case.
My Questions are:
1- How to solve dependencies problem using UnmanagedExports?
2- If no solution for problem 1, what is the best approach that i should use to complete this task.
I think that Java Applets can setup an application on client PC, this application can run on a standalone app context (this application will be a c# application that can perform the task on the background and gives the feedback to the Java Applet). Is this possible?

To answer your first question, try Dependency Walker for resolving dependencies for a specific DLL.

Related

How to self-update a Java Desktop Application?

I built a java desktop application with Java8 and JavaFX. And everything works fine.
But now I have a new challenge! I googled a lot about how to self-update a java desktop app, but all the results I found were old.
Is there an Open Source library that can manage self-updates for java applications like https://github.com/Squirrel?
If not, what is the best way to build something that will allow my desktop app to self update?
Thank you.
There is a lib called UpdateFX which handles the update process for you. Only drawback is that it only works with single jar apps so if you are using extra libs you have to extend it.

Can Java inject DLL in another process?

I've actually already asked questions regarding my problem. To prevent people asking for irrelevant details over again, I'll post this background info you can skip:
I'm making a automation application. This application does some tasks
for the user over time for specific window. When these taks are
required to be made, window flashes in taskbar and sometimes even
steals focus to get the user to do the task. Once the automation is
here, this is no longer wanted - the user will only focus the window
when he wants to check how well is the automation doing it's job.
I discovered this focus and flash disable dll project thanks to this superuser post about applications stealing focus.
My automation application is in Java. So while I can open a DLL injection application and disable flashing manually, I'd like to integrate it in the java applicaton - for example as a setting option. When user selects to disable flashing and stealing focus, the dll will be injected.
Of course, this requires Java to be able to inject my .dll file. I've found this project: dotnet-dll-injector but it only deals with .NET dll files.
Q: Is there a way, in Java, to pick a .dll file and inject it into process? Which libraries would lead to this if the solution isn't straightforward?
I've noticed CreateRemoteThread is somehow related to the DLL injection. Maybe JNA library supports that?
I don't know of a way to do it natively in Java.
Since you've found a working solution in .NET and your task is Windows-specific, I suggest the following:
Build dotnet-dll-injector as a DLL and call it from your Java app. How to call into .NET dll from Java
Edit: easier to build it as a console app and use Runtime.getRuntime().exec("...");
Or if you're still early in the development process and you have no immediate plan to go cross-platform, just do everything in C# and save some headache.

Compiling Eclipse project without Eclipse after finishing

I have two questions:
Background: I am trying to create a RESTful Java API for Java back end server which I have already finished.
1) Researched online, and the best way to do this by using Eclipse, is it possible to create a RESTful Java API (using Jersey) without having to use Eclipse? If so how?
2) Let's say I do use Eclipse. After completion, can I transfer the project to a Linux machine and run it there? (if it doesn't have Eclipse). My Linux machine will be the main host, I'm currently working on a windows machine.
Any feedback on this will be greatly appreciated!!
Thanks!

Capturing And Sending Video on Java with Jitsi Library

I'm trying to develop a video chat app on java. I found libjitsi, it uses native libraries. There are two example codes which called AVTransmit2 and AVReceive2 (if you want to look: https://jitsi.org/Projects/LibJitsi). But i can't run any of them. I think I don't know how to add native libraries. When i link the native libraries with that:
System.load("the path of the native library")
all of them seems added except one. The one which stops the running with linking error, the one which called AWTrenderer needs links for more libraries. But libjitsi gives me enough libraries for run the code i think. But i still getting linking problem at output. So where is the problem? Can anybody help me please?
Solved. I didn't use system.load for linking the native libraries. My IDE's (eclipse) got a configuration for it. You just selecting the folder which includes native libraries.

networking applets not working in chrome

I have recently created a Java applet which creates a socket and performs some networking functions. The applet works fine when run in an applet viewer. But when i try to run it in a
google chrome, it is launched but its not performing the desired function.
I used (ofcourse) java.net library and my applet runs without a main method.(Old applets unlike swing components).
Is not having a main method a problem ??? Please help :) thanx
Actually after a bit of research i came to know that Java applets have many restrictions due to security reasons... which include specially on creating the SOCKETS!!.
If you really wanted to communicate using Applet then you have to run it independently, to accomplish this you should have the applet digitally signed which is too tough to obtain.
Instead you can create the JAR version of the applet and then convert into exe application using jar2exe converter and use it.

Categories

Resources