How do I use MAMP to display html/php and GWT code? - java

I have website files running on my local server using MAMP. The project was previously developed using gwt. I have installed gwt and ant.
Where do I put now my html/php files to be able to compile the java files and, in the same time, to display my html/php files on my local server?
Thanks!,
Mehdi

You mixed several things here, I'll try to make it simple:
GWT code is written in java, but eventually it compiles to javascript, so the actual code you deploy is javascript.
HTML/PHP/javascript/css files should be put under MAMP/htdocs
If you have the source code of the GWT application and you want to view/edit it, you can do it in a regular notepad, but i strongly recommend using an IDE (Integrated Development Editor) like Eclipse.

Related

Copy compiled binary files to remote system

I'm developing simple Java application in Eclipse Oxygen. I would like to ask Eclipse to copy binary files to testing machine automatically when it builds. How to achieve that? How to run script on remote Linux machine that restarts application when binary is copied?
UPD
Since Eclipse builds project very often I would like to have Deploy functionality according to request. How to achieve this option?
Look at the 'Builders' page of the project 'Properties'.
You can add an 'Ant' script or a program to be run when the project is built along with the other builders.
Builders normally run quite a lot so you may want to turn 'Build automatically' off.
It is also possible to write an Eclipse plugin which contributes additional builder types - but that is more work.

Auto compile SCSS in netbeans plain java project

I am working on a small pet-project which is primarily a java desktop application. It has a embedded web server (tomcat) to allow for remote control.
I have made the design decision to go all out with modern HTML technologies, netbeans has been able to provide all the relevant IDE features required EXCEPT SCSS auto-compile ( this works perfectly well on a HTML project) but this is a "Java Application" style project (as I want to embed all the static html/css/js content inside my jar deployable and then drive my desktop application via REST.
I guess you may be intressed in compiling your project with libsass. There are two implementations for Java. In this case it is easily integrated in the compilation step.
If you are not satisfied with it, you can integrate a frontend task runner into your working environment. Consider different options: Grunt, Gulp, etc.
I personally use Grunt for my daily routine. When speaking about Grunt, you will need to install two tasks: grunt-sass (it is different from grunt-contrib-sass) and grunt-contrib-watch. The second task compiles your .scss or .sass files on file-change. In this case you can have your .jar file filled only with desired .css files built for you by a task runner.

How to Point Apache Towards a Vaadin (Java) Project?

Sorry if this is the wrong kind of question but currently I have an Apache server which is configured for Pyjamas. All I used to have to do was: pyjsbuild example.py and the GUI would appear in my browser.
I decided to switch to Java, so I picked Vaadin as my framework. How do I do the equivalent for Vaadin? All I want to do is compile the java and have Apache recognise it.
I'm using linux and I'm very new to building web applications, previously I only ever built the GUI side of things, I never had to touch the server.
You need Apache Tomcat to serve java pages. Install it separatly or see http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html for information on how to hook them together.
Vaadin projects work just as any web project. You have to crate a WAR file.
For example, if you are using Eclipse, right-click on the project, choose "Export..." and under "Web" choose "WAR file".
If you are using Netbeans or something else, google "create war in netbeans/intellij/..." to find out how to do this step.
This will generate a file with the extension .war, which you will have to copy in the "webbaps" folder of your Tomcat installation. Restart Tomcat and the application will be automatically deployed.
If you do not have access to the webapps folder, go to Tocatmcat's "Manager App" in the browser and
under the section "Fichier WAR à déployer"(WAR file to depploy) choose the generated file and click Deploy.
To start with, make sure that go through Getting Started chapter in Book of Vaadin. In this chapter you will find overview of the required toolchain and step-by-step installation instructions. Your Linux distribution might have more documentation about installing JDK (For example, see Ubuntu wiki for Oracle JDK installation).
It will be convenient for you to connect Tomcat to Eclipse IDE. This makes starting Tomcat and updating your application easy. For example, see this [blog] for some videos about connecting Eclipse to Tomcat.
Please note that using Eclipse is just one approach and later you might want to see if IntelliJ IDEA or command line works better for you.

How to run php file in eclipse juno

I am new to PHP.
I am using eclipse juno. Now, I want to use PHP in my eclipse. So, I installed the PHP plugins using new software installation.
I need two things to do.
1.created a PHP project, and php file but I am not able to run the PHP file. When I try to run it, it is showing
Page load failed with error : Could not connect to server.
2.I have a project already in eclipse, I need to add a PHP file to it.
First of all is it possible or not.
I am able to create a PHP file but even here also I am not able to run the PHP file. It is not showing any output, when I run it on tomcat server. I read that I need to download php-java-bridge.war file, I downloaded it but don't know how to add to the project.
To run PHP file you need a server running which understands how to handle php files.
One of the ways to do that is to run apache web server with php installed.
If you want to use tomcat and php-java-bridge.war, from what I see on their website, you probably need to create a new project from extracted war and start adding files to it.
First of all,we need to download and install the XAMP web server which is used to run the php files.
You can see how to download and installing XAMP in mac in this below video.
https://www.youtube.com/watch?v=h4m2k1Cmx8I
To run the PHP files, first start the MySql Database, Apache Web Server, and ProFTPD in the XAMP server. And also, we need to create the project inside the htdocs folder. If you want to run a PHP file in the existing project, you can store a copy of that project in this folder.
This will help to run the PHP files.
I am a PHP Developer and It's better to use other IDE like Zend Studio and PHP JetStorm and as they are not free you know how to get it.You are newbie to php so I would highly recommend Zend Studio IDE as it is made from Eclipse and has the integrated debugger in it.
Just refer to this link
What is the best IDE for PHP?

xampp and tomcat and jsp oh my.. how do i tell if its working

Ok recently installed a wamp xammp to be specific.. I have a requirment to use jsp for some server side communications instead of other stuff like php. My main issue is not knowing jsp enough or java for that matter to know whether or not what I'm trying to do is working or if its not and if its not is it cause of the code I'm tempting to try which is a copy and paste solution via Google for "jsp hello world". Xampp reports tomcat as active and running but I copy and paste the jsp code I find to see if it works and when I go to it in my browser I just see the source as if I were looking at it in notepad, so anyone got some advice? This is a stock install if the latest xammp.. the server runs fine other wise php and mysql included.
Make sure that the file has the .jsp extension and that it's been placed in a subfolder of /xampp/tomcat/webapps (and thus not there where you usually drop PHP files).
See also:
Youtube video tutorial - Integrating Tomcat with Apache using XAMPP
Install NetBeans IDE and follow this tutorial: http://netbeans.org/kb/docs/web/quickstart-webapps.html (before running application in this tutorial you must stop your XAMPP Tomcat).
Or if you want to use your XAMPP Tomcat, integrate it with NetBeans, create a web project using that tutorial, create a WAR file (by clicking on button Clean and Build) - this will create a WAR file in your project directory in directory "dist" and then copy this WAR file to your XAMPP Tomcat into directory webapps.
Start small, use NetBeans IDE, read some tutorials and experiment. Later you can switch to Eclipse IDE (IMHO buch better IDE, but requires much more customization than NetBeans).
Dont use Notepad.

Categories