How to run java code in HTML [closed] - java

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 7 years ago.
Improve this question
I have a piece of java code I would like to run in my web browser and publish online. How can I do this without using applets? I have tried java vertx but I am not sure how to use it and there are no good tutorials online.

The short answer is you can't. Browsers don't "speak" Java natively, which is why applets required a plugin. As you probably know, Google is in the process of removing support for the plugin technology used by the Java plugin (NPAPI) and so soon Java won't work in Chrome at all (it already doesn't under Linux).
Your only real options are:
Provide a means of running it server-side, like http://ideone.com and various other "online" compilers do.
Translate it from Java to JavaScript (either manually or using a tool), which the browser can then run. But note that Java and JavaScript are not only markedly different languages despite a superficial similarity in syntax, but the standard environment for each is also quite different from the other.
How you do either of those is much too broad a question for SO.

Related

Running old Java applets from book "Data Structures and Algorithms in Java" [closed]

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 4 years ago.
Improve this question
I am trying to run the Java applets that accompany the book "Data Structures and Algorithms in Java" by Robert Lafore.
They can be found on this site
https://cs.brynmawr.edu/Courses/cs206/spring2004/lafore.html
The applets do not work for some reason. I've tried adding the different url's for the different applets to my exception site list under Java's security configuration, but that didn't help.
Anyone know what might be the problem?
As already said, you should rather avoid applet based samples. However, if you still need them, take a look here:
https://download.java.net/openjdk/jdk7u75/ri/jdk_ri-7u75-b13-linux-x64-18_dec_2014.tar.gz
You will find appletviewer there. Appletviewer allows you to run applets. It might be you will have to play with JAVA_HOME environment in order to make sure you use this particular version of Java.

How to use PHP/HTML as interface and Java/Python as function in background? [closed]

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 6 years ago.
Improve this question
I'm thinking about writing a desktop application that the GUI is made with either HTML or PHP, but the functions are run by a separate Java or python code, is there any heads up that I can look into?
There are a couple of possible options:
Run your backend code as an embedded HTTP-server (like Jetty* for Java or Tornado* for Python). If the user starts the application, the backend runs the server and automatically starts the web browser with the URL of your server. This, however, may cause problems with the operating system firewall (running a server on the local machine)
You could also have a look at CEF (chromium embedded framework). It is made for exactly this purpose (running an HTML-Application inside your code). It uses the same codebase as the chromium (and chrome) web browser. It was developed originally for C++, but there is also a Java binding: java-cef
Oh and by the way, PHP is a server-side language. I would not recommend to use it in your scenario (since your backend code is Python or Java).
*I have not enough reputation to add more than two links, so you'll have to google those ones yourself.
You could expose data from Java or Python as JSON via GET request and use PHP to access it. There are multiple libraries for each of these languages both for writing and reading JSON. GET request can take parameters if needed.

How to keep a Java program secure from hacking [closed]

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 8 years ago.
Improve this question
I created a Java programm which works on the serverside to communicate with an Android-App over Sockets. Now I want to check wether it is secure to hacking. I also asked in the Security.SE forum but this is programming related. So what do I need to look for in my Java-program to make it heavy to be exploided?
The first thing to check would be the server it's running on. You can cerainly checkout the https://www.owasp.org/ website. It is always a good source of security threats. Then there are a lot of pentesting tools https://www.kali.org/ has many of them built in.
But the most important might be how you've designed your API, I mean you're not very specific about what you need to know but some rules that will certainly apply:
secure the communication
make sure id theft is as hard as possible
never store userpasswords yourself(use a tokenbased system like oauth)
Obfuscation via proguard makes the program harder to reverse engineer.
Obfuscation combined with Ahead-Of-Time Compilation
1) Obfuscate names and encrypt strings using the tools not relying on the application being delivered in bytecode form. Make sure to disable control/data flow obfuscations.
2) Compile the obfuscated application down to optimized native code.
see link
http://www.excelsior-usa.com/articles/java-obfuscators.html

Checking System requirements for the application in java [closed]

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 8 years ago.
Improve this question
I am building an application using java and oracle database. I want to confirm all the required software is installed and working properly on each time the user open the application and show the missing software/configuration error to the user and option to close the application.Is there any way.
You probably can't from a pure Java perspective, nor should you. That is really a job for your installation process. Every native platform you deploy to is going to have a different way of installing software and a different place to put it. If you really want to do this because you are doing your instillation with Java (and love writing more complicated code) you will need to leverage something like JNI or JNA to ask the underlying operating system what is installed. This is fairly simple on Windows and OS X, however, it's going to be next to impossible on most Linux's due to the differences in each package manager.

is it possible to build a debugger around the java scripting engine? [closed]

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 5 years ago.
Improve this question
we are using the java 6 scripting engine in our product, and now we are thinking on adding some debugging abilities.
my question is:
is it possible? does the java 6 scripting engine has the same capabilities like rhino as far as debugging.
some documentation about how to start doing it, some code samples any information would be great since i could not find anything on the web.
thanks
I'd start by looking at how the open source Firebug (www.getfirebug.com) tool is implemented, unless you're completely wedded to the idea of a "pure" sand-boxed Rhino environment (and even then Firebug could probably teach you a few things).

Categories

Resources