Open my Java application on local website (HTML) - java

I've finished my project in Eclipse en build the Java.jar file, it runs fine when i click it on my browser but now i want it on a local website so for examle c:/user..... so it will run in the browser but how can i do that ?

You can not just simply run a java application with a web browser only from your hard drive...Unless it is an applet like the previous owner said.
In general you will need to setup some kind of application server (tomcat, jboss,...)

is it an application or an applet??.
Unless the jar file also contains an applet class, there's no way to get it to work in a browser as is.
Check this out this Applet Class.
You also need
TomCat or Glassfish

Related

How do i convert a dynamic web project in eclipse to run from an icon on desktop?

I have a dynamic web project in eclipse. It has html files, Css file, js files, java files, jsp files, and etc. It also is connected to an oracle database, which the dynamic web project inserts, updates, deletes and shows data into webpage. The web project works fine in eclipse IDE, and can run it on the external web browser.
I need to take the dynamic web project and put it on the desktop, such as a shortcut icon. So, i want to be able to open the web project from the desktop and be able to run directly on the web browser, like chrome. The reason is I need to send that web project to other users to test, and see if what changes needs to be made. The users do not have eclipse on their systems. Is there a way I can send them the app. as a desktop application?
If not, Can anybody help me on how I can do it on my local system?
For the run of web_application with some jsp-files you need to have one servlet container as Tomcat or Jboss, Wildfly e.t.c. This container must be for you available over the network ( mayby official IP-Address is necessary). Then you can access to URL of your web-application with your local browser and observe the work of your application. With the icon and one link you can start the web browser with your required URL too.

What URL used to unblock Java Security for local JNLP

For the life of me, I can't figure out what to give Java Security as a "URL" to unblock an application launched by a JNLP file in my own file directory.
When I use my browser to call the JNLP file from a Java EE application deployed to my glassfish server, I have a "URL" so I can unblock that.
But for testing I'd like to be able to also just double click the JNLP file in my local PC directory to launch the app.
It can't be that difficult. Double clicking the JNLP file does in fact begin to launch the app. Just Java blocks it. And I just can't figure out how to unblock that kind of call ... and can't find any reference to that simple a need.
Have you tried:
file:///path/to/application.jnlp
?

Package DukeScript client artifacts in a war and serve from a web container (such as Tomcat)

I've followed the instructions here to create the sample DukeScript "Words" app. Everything works fine. I'd now like to serve the application using a web container. Is there an example of how to package the whole thing so that it can be deployed in a web container such as Tomcat.
Ideally - what I would also like to be able to do is make code changes, deploy to Tomcat, start tomcat, fire up my browser and visit the app. i.e. follow the normal Java webapp development cycle.
Is this possible?
In this scenario Tomcat wouldn't do anything but serve static content. The words application is pure static client code (no servlets, nothing...). So you can use a simple browser to access the index.html on disk. If you insist on using tomcat for development: There's no need to redeploy. The only thing you need to do is configure tomcat to serve the static content that the build generates. If you named your application "helloworld" this would be:
/helloworld/client-web/target/helloworld-web-1.0-SNAPSHOT-bck2brwsr/public_html
Make your code changes, build, reload the page in browser and the browser will see the updates

Unable to run an Eclipse project in a local web browser, access the database, and run the project

I am currently doing a web application project in Eclipse. I understand that the project done in eclipse runs on a local web browser (i.e. in my eclipse web browser). What I don't understand, if how we can execute or run that project in my local browser, such as Google Chrome, or Firefox etc.,
In order to do this, I tried to copy the web url address from eclipse and pasting it into Chrome. The user interface is working fine. That said, it was not supporting the database when i tried to login. Logging in gave me the message "login failed".
Can some please help explain where to store my database and how to run my project in a web browser that is built in eclipse.
There is no difference accessing the application from the MyEclipse web browser or from an external web browser. The web application is simply serving pages to the browser in response to input from the user. If you are using the built-in Derby database, for testing, make sure the Derby database server is started in MyEclipse (right-click on MyEclipse Derby in the Servers view and select Run Server), before starting the server containing the web application.

How to deploy a Eclipse Java Web Dynamic Project on Amazon EC2?

I'm trying to create a web project that is able to communicate with Amazon RDS. I know how to make a localhost project connect to a RDS with JDBC.
However, the problem is that I never tried to deploy my project (so that, for example someone can type somePage.com, and go to my webpage).
I have an Amazon EC2 instance, and I've already written a simple hello world jsp page. I am able to compile it and run the Eclipse Web Dynamic Project using the installed Apache Tomcat Server, and then typing localhost:8080/somePage then I can see my hello world popping up.
However, how do I deploy my project on this EC2 instance? I'm using Windows Server 2012 edition.
My whole idea is that once I have one AMI image all setup, then I can just use autoscale to scale my webpage with that AMI image.
Can anyone point me to the right direction?
Follow the steps below:
Setup Apache Tomcat on your Amazon EC2 instance.
Usually all you have to do is download the current version, unzip it, and start it by running apache-tomcat-folder\bin\startup.bat. (You can also donwload an installer and set it up as windows service. Check this link for more details).
Make sure you test it before continuing (open its address on a browser, something like http://yourinstaceaddress.com:8080/).
Export your web application .war file
In Eclipse, right click on a Web project and select Export. Then select WAR file in the Export window and then select Next. Choose the project, the .war file name and folder to export. More detailed explanation can be found here and here (with pictures).
Deploy the .war file to your Tomcat Server
The, by far, simplest way to do this is to place your .war (say myapp.war) file in your apache-tomcat-folder\webapps\ folder.
There are other ways, like via Tomcat Manager. But they can be tricky and, as a new user, you should avoid them. (Don't worry: the simple method is ok for production deployment).
Test your web app
Visit the url: say your .war's name was myapp.war. You should visit http://yourinstaceaddress.com:8080/myapp
That's it. If you ever edit the app, repeat steps 2-4 (but delete the webapps\myapp\ folder created before executing step 3).
Boxfuse does exactly what you want.
For you Java web application you literally only have to execute:
boxfuse create my-tomcat-app -apptype=load-balanced
boxfuse scale my-tomcat-app -capacity=1-16:t2-micro:cpu25-75
boxfuse run my-tomcat-app-1.0.war -env=prod
This will
Configure your application to use an ELB
Set it to autoscale between 1 and 16 t2.micro instances based on CPU usage (scale in at 25% and below, scale out at 75% and above)
Create AMI containg Tomcat and your application ready to boot
Create an ELB
Create a security group with the correct ports
Create an auto-scaling group
Launch your instance(s)
Any subsequent update will be done as a zero downtime blue/green deployment.
For your domain, you can simply map your samepage.com DNS record to the CNAME of the ELB.
More info: https://boxfuse.com/blog/auto-scaling

Categories

Resources