Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I have developed apps using Swift as an Agent. It was a simple application that sat in the menubar without any icon on the dock. I would like to create one using Java for some accessibility reasons and I stumbled upon something called a Javaagent.
I couldn't tell if that was what I was looking for and don't want to dive in if its not. If its not, was am I looking for? How do I make an application that doesn't have java popup and just runs on the menubar?
I have looked on many different sites on how to make one but none explaining what it actually is:
example of how to create java instrumentation agent.
Tutorials about javaagents
A java agent is a basically a specialized "component" that you can load into a JVM that runs your "core application". The agent then provides certain "add-on" functionality; functionality that has nothing to do with what your "core application" is doing.
An example would be JRebel. That is a commercial product which comes Java agent; it is loaded into the JVM when starting up your application server. JRebel then allows you later on "hot swap" java classes. Meaning: the JRebel agent knows nothing about the purpose of the code that you are running within your application server; it only exists to change the bytecode of your classes while the JVM is still running.
Long story short: java agents are for INSTRUMENTATION; they have nothing to do with UI applications or accessibility. Thus the answer is: no, java agents is not what you are looking for.
Instead you might turn to frameworks like Swing, JavaFx or Eclipse RTP; which help you creating GUI applications.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Suppose I have to run a java, c++, or python3.8 program on my machine, but I don't want these programs to access my system information, run os commands, or perform any malicious activity. Is there a way to do this for each of the aforementioned languages?
Java theoretically has a solution for this: The 'SecurityManager'. You can set one up within your java code (you can tell the system: Here is some code; load it as the manager please).
A securitymanager gets called before certain things happen and can deny the operation. It's mostly anything that feels security sensitive:
Quitting the VM
Opening any file
Opening any network connection
Setting the security manager
accessing clipboards
Printing things
Can influence certain aspects of thread loading
You'd tell java to run some class file that you wrote, that class file sets up a security manager, and will then run the application you want to restrict.
Note that you can't really restrict how much memory and/or CPU it uses with a SecurityManager, which can be quite an issue by itself.
The problem is, the primary use case for this mechanism is to run applets, and applets are long dead. Thus, it's a feature that few people in the java ecosystem are currently using, and little-used blacklist-style mechanisms are usually riddled with holes.
I'd strongly suggest you set up a virtual machine for this purpose. There are leaks in hypervisor based restrictions too, but 'host things in a VM and ensure it cant do things to the underlying machine' is a lot more common.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I want to mutate a function of a class that is loaded at runtime (it has a bug in it but the project is long gone so i cannot build the binary). What i want to do instead is write a piece of code which will run during the application initialization phase and mutate this function so that it works fine. And simply keep that code around until the replacement is ready.
Having no experience with bytecode modification what library could i use to modify and reload a class at runtime? Specifically i need to replace a throw instruction with a noop instruction (i did this once using hex editor but lost the binary).
Also if you know any tutorial on how to do something like that please share.
I can see many libraries for doing this but i cant know which ones are good/bad do the job...
I think use Java Attach API. Java Attach API is procedure of loading a Java agent into an already running JVM. you can understand the work of javaagents by reading the Java Instrument javadoc. AgentMain help to you.
Agentmain is invoked when an agent is started after the application is already running. Agents started with agentmain can be attached programatically using the Sun tools API (for Sun/Oracle JVMs only -- the method for introducing dynamic agents is implementation-dependent).
This tutorial is useful about java instrumentation.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Is it possible to write enterprise web applications in PHP as it is in Java (with Java EE stack of technologies)? I know just a bit of PHP and I've always seen it like a request-process-response programming/scripting language with no objects staying alive on the server (like #Stateful ejbs) after the script has finished its execution.
To put it in another way: can the same web application be implemented in Java and in PHP? Or is one of the two languages more powerful than the other?
Edit: let me clarify my question: I already know Java and have some experience in enterprise web applications. I want to know if PHP is equally powerful (in language structure, in today available frameworks, and so forth) to make the same complex applications that can be done in Java.
Not more powerful in the sense that you could write something in Java that would be impossible to replicate in PHP. I'm not familiar with PHP, but there's most likely similar frameworks and libraries that have been created for PHP that exist already in Java (such as an ORM framework like JPA).
Stateful EJBs aren't that special (and not that common either). You can readily store information in the session whether you're using Java or PHP.
This isn't really a suitable question for SO either, since programming languages are different and frameworks are different and you'll never find the "best" something, because that doesn't really exist.
Solution: learn both.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm developing a java-database desktop application using netbeans and swing. The application has so many features that creating gui has become a problem and it has a very old look when compared to other modern applications. I found javafx, swingx, jgoodies, netbeans platform and so on...and the discussion on these topics is never ending!! I need good support for customising tables,trees, toolbars and skins. what should i use??
i would suggest you to go for javaFX. I had earlier worked on swing but now moved to javaFX.Benefits are
Good look and feel
can be used server side also.
Use the simplest method possible. Seriously, whatever you find easier go with. I find Eclipse Windows Builder is better than Netbeans but if installing the Eclipse plugin. Netbeans is probably a lot simpler than Eclipse Window Builder, but some people like me prefer Window Builder. Go with whatever you find easiest.
GUI building is complex in Java, they designed it well so it is hard as a novice to jump in, and it is better to start running then learn as you need more complex features. Google then becomes a good ally.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
As i am working in government project and they are telling us to be use Java Applet for their website like lots of bank website uses for login. Is this a good idea to use Java Applet? As we have lots of good framework like JSF, Struts ,Zk etc. Still Applet give us advantage in any context if yes please let me know.
applets will give you a java UI inside a browser, but they are crippled for security reasons and also most of the java security vulnerabilities discovered are usually around the applet area.
using java web-start will give you a web-launched (from clickable link) full-blown java application with less security restrictions and less security vulnerabilities to be worried about, while not requiring anything special on user's machines (you need java installed on users machines for both applets and web-start to work).
so, in my opinion, web-start simply makes applets obsolete.