When I deploy Java Web Application on Tomcat server with Maven, I don't know how to write JS in realtime without redeploy. If I create and save JS in Chrome Dev Tools I have to redeploy my application every time.
If I use NetBeans for JS development, it puts changed files in /target folder . Which is used by tomcat. I would develop in NetBeans if it had JS console (but I didn't find JS console).
What should I do? How do people develop and debug in this case?
You'll want to use both NetBeans and Chrome dev tools in conjunction. Make your changes in NetBeans with hot deploy but use Chrome dev tools for debugging, placing breakpoints etc.
You might also find this useful: https://softwareengineering.stackexchange.com/questions/143453/best-way-of-javascript-web-development-in-netbeans-hot-deployment
The latest (8.x) Netbeans have a plugin for Chrome(ium). You can then use breakpoints from your IDE and have the browser console output in your IDE as well.
While it has some shortcommings compared to the chrome dev tools it provides a very good developer experience due to the good integration. You should really give it a try.
Related
I have a dev machine, which deploys a java project to a local jboss server.
I have an IntelliJ maven project that has some html/js/jsp/servlets, etc. Is there a way to edit the code of the html/js files and then do a refresh of the webpage and see the updated changes without having to redeploy?
When doing just front end apps, I can accomplish this with a node server using gulp watch.
I'm hoping for something similar with my jboss server setup (intent is to simplify architecture and try to get the same front end development speed but have it all contained within a war). If I need to some how use gulp watch with maven, I'm good with that too, as long as I can make changes in the front end code (html/js, I assume changes to jsp/servlets would require a redeploy) and refresh the webpage and see the changes right away. I've also seen people write scripts to copy files from source into an exploded war before, but nothing that was automatic like gulp watch. My googles have failed me, anyone know how to accomplish this?
I have referred to the question Here and have been unable to resolve my issue at all.
I'm making a dynamic web project that uses jsp / css as well as jquery. Right now I need to stop the server, clean, and republish.
I have build automatically checked, I have selected automatically publish on the server... I'm not really sure if I'm missing something but I'd love to get this working as frontend development without realtime editing is horrid.
I'm not using maven or any other form of source control (yet)(I can add in ivy, if need be?)
Thanks.!
Image of server setup
If your are using the JBoss Server Manager that came with the Jboss Tools Suite you have to mark the "Automatically publish when resources change" option of the "Publishing" section of your Jboss Server Configuration.
You can find the Jboss Tools for Juno here, or you can use the Jboss Developer Studio IDE, that is an Eclipse Indigo + Jboss Tools like explained here (I'm using it, and it runs way better than eclipse, don't know why, but that's just my experience)
Trying to run basic java application (backbone.js and jax-rs) I was pleasantly surprised that modifying js or html file in src/main does not require application rebuild. Just refreshing it in browser is enough to update the application.
However changing java file, I can't find how to make application be updated locally.
Using Eclipse it's automatically compiled into target/classes, however applicaiton is not updated in browser. I can't find any bees command to cause update. I don't see compile command also.
Killing running tomcat and 'bees run' makes the trick, but the question is, if instant update is possible in case of basic java web application?
I'm not sure how to do it with a normal Java app. One option would be to use Playframework has this auto-reloading stuff built in, and is supported well on CloudBees. http://wiki.cloudbees.com/bin/view/RUN/Playframework
You need to use something like JavaRebel or Javeleon if you wish to reload Java classes in a running application.
I've created a standalone java application using Netbeans. The application works in ubuntu 10.04 environment. Now I want to create a setup for my application so that I can distribute it to others. Also the path variables need to be changed depending upon the system on which i is installed. Can anyone suggest me how do I do so?
Hello you can make an installer for your application.
In the link below you will find a nice help about izpack installer.
http://www.imrantariq.com/blog/?p=89
Link below contains a detailed pdf to make installer with izpack.
http://www.imrantariq.com/blog/?attachment_id=112
cheers
Imran tariq
Try Flexera's Install Anywhere. It will suite your requirement. It offers lots of stuff customizing the installation process, customizing the UI, etc; Install Anywhere
I suggest you to use izpack which multiplatform and is free (at least as beer).
You can package your app as a JAR if it's a Java app that runs from main, a WAR if it's a web app deployed on a servlet/JSP engine, or an EAR if it's an EJB app that runs on a Java EE app server.
All these presume that your client has a JRE, servlet/JSP engine, or Java EE app server to run the app.
You may use the osxappbundle-maven-plugin for Mac support. You don't need a mac to use it.
http://mojo.codehaus.org/osxappbundle-maven-plugin/
Nobody mentioned NSIS.
I've been stumped for a while trying to figure out why my GWT demo app isn't working in hosted mode so I went back and downloaded the Google Web Toolkit again, unzipped it and simply went to the samples directory and ran "ant hosted". The hosted browser launches and only shows the static html content but none of the dynamically generated js widgets, etc. However when I click "Compile/Browse" the examples launch correctly in Firefox. What could be wrong with my setup/environment?
I followed the link you provided to download gwt. Extracted and ran "ant hosted" under samples/Hello, samples/DynaTable, and samples/Showcase and they all worked successfully. I'm also running Windows XP and java 1.6.0_11.
I think that running "ant hosted" starts an embedded Jetty server that listens on port 8888. Hosted Mode Browser makes requests to that embedded server, for example: http://localhost:8888/Showcase.html.
Also, when you click "Compile/Browse", it opens your default Browser (in my case it's firefox) and it tries to make a request to the same embedded jetty server that the hosted mode browser uses.
So, if it works in your browser, then the browser is connecting to the embedded jetty server. It's very strange that hosted mode doesn't work properly but you're able to view in a browser.
I believe the difference here is that hosted mode runs pure java (some sort of javascript emulator, I'm not sure I understand 100%), while the browser is running javascript.
So, I suggest troubleshooting the jvm that is started when "ant hosted" is run. Maybe the jvm is running out of memory or something when you load it up in hosted mode browser? Maybe you can pass some jvm args to the ant script to fix the problem?
Sorry I can't be more specific, that's a strange one!
#Chris: I suspect this question may have something to do with your earlier question if it is on the same computer that you were using. The solution may be to clear your IE cache because it tends to cache the 'script' tag contents and when it got messed up earlier while you were importing other stuff, it may still be sitting around in IE. Found the potential answer at this link.
I created a new workspace, re-imported everything and used GWT 1.6.x instead (because Ext GWT 2.X, which I need for this project requires GWT 1.6.x). This did the trick... everything works ok now.
The main difference I can think of is that in the Compile/Browser you are opening the html host page like a regular file, while in the hosted mode (even in a client sample) it has to be provided by the http server via localhost:8080. Check if the server is beeing started.