Converting an Eclipse Java project to a Google AppEngine one - java

I have a project with a large amount of pre-processing. I have written this part and would now like to convert the project to a GAE project.
I have enabled the GAE support in Project->Properties and have some functionality but when I want to testrun the app I get a "Web application archive directory does not exist."
Is there a way to automatically generate the missing folders and files or do I have to do that manually?
I do not want to copy my classes into a newly created project since that would mean loosing all my version control.

I think that with the GAE plugin for Eclipse, you can create a GAE app skeleton. You just have then to move your old project files into this project, and you're done.
For just conversion, I don't know if it's possible, if the structure of your app is completely different from the GAE structure.
As for the error you have, it seems that your app lacks a WEB-INF directory that any webapp needs to run.

I am using GAE Eclipse Plugin 1.2.1 and Eclipse 3.4.2 and I have tried the same operation and have been unsuccessful so far. I believe the eclipse plugin is hardcoded to look for the various components at specific locations. (The right approach would have been to configure the GAE plugin to look for the all the WEB-APP components at other locations than the default.) I would think that given these versions, converting an eclipse project directly wouldn't be possible.
A possible solution, given this constraint, would be create a new GAE project and copy all your existing code into that structure without altering the folders already created by the GAE plugin.

Don't know if this will work for Java -> GAE project conversion, but I've had luck doing something similiar, converting General -> Java projects using the following steps:
Close your project.
Open your project file (which is located in your root directory of the appropriate project) called .project with your default editor. Search for:
<natures>
</natures>
and change it to
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
Store the changed file.
Open the project again - now it's a java project.
Of course you'll need to create a new GAE project and then look inside its .project file to get the correct element contents.
I found the above steps googling around, so I can't unfortunately credit the original source of the above instructions.

You CAN convert your existing eclipse projects to GAE projects. All you need to do is right-click the project and choose settings. Then choose Google settings and tick the "use Google App Engine SDK" option.
Using Google Plugin for Eclipse with existing projects

Not sure about the whole GAE specific stuff, but you can copy your old projects contents:
Create new GAE-Project
Close it
Use a file manager outside eclipse to copy all your old projects contents into the new project. Make sure, you include the ".svn" folder, it may be invisible in the explorer/nautilus/whatever. You should also think about leaving the .project file of the new project alone, as it may contain GAE specific configuration.
Open the project in Eclipse again
Right click project -> Team -> Share project -> Select SVN
Your old project URL should be already there, leave the radio button with "Use project settings" checked.
The project connects back to the old repository location, and in sync view you should see the new files as outgoing.

To complete #Marks response, you should add this line to your .project file:
<nature>com.google.appengine.eclipse.core.gaeNature</nature>

Related

Export wizard application in netbeans

I did a sample application mentioned in this link using Netbeans Wizard template https://platform.netbeans.org/tutorials/nbm-wizard.html
But how do I export as executable jar. I just want to execute the project independently with out IDE. Any suggestions.
I can't find it in the tutorial that you point to but in order to share your newly created Netbeans plugin you need to export it as a binary NetBeans Module or .nbm file. Right click on your project and select Create NBM. Check this old tutorial here: http://docs.huihoo.com/netbeans/6.0/kb/60/platform/nbm-google.html
For Netbeans 8.0: When the file is created you can then go Tools->Plugins , downloaded tab and then click add plugins
EDIT (based on your comments)
The tuturial you point to guides you to build a custom Netbeans module (in this case a Wizard). The module is packaged as a .nbm file which you can then distribute it so that it can be installed to any Netbeans IDE.
As it turns out you need something like a "Java swing wizard" application. By searching google you can find some results that fit your needs (these are from the first google results):
http://www.oracle.com/technetwork/articles/javase/wizard-136789.html
https://code.google.com/p/cjwizard/
http://www.javaworld.com/article/2077850/java-se/open-source-java-projects-the-wizard-api.html
http://sourceforge.net/projects/jwf/
Similar question (maybe you can post a comment asking for details there):
https://softwareengineering.stackexchange.com/questions/132723/is-there-a-java-library-to-create-assisted-wizard-flow-into-your-desktop-applica
Hope I am not leading you to the wrong way but another thing you can also have a look at, (haven't checked it myself but you might find it useful) is how to create OSGI modules and the posibility of converting Netbeans modules to OSGI modules.
Look here: http://wiki.netbeans.org/OSGiAndNetBeans.

Java project from existing ant build file doesn't appear as in version control

I have a repository in which I have a simple ant project (only the src directory and the build.xml file). I did a checkout of this project in a local copy. Then I opened Eclipse, created a "Java Project from existing Ant build file" and it worked fine. I can build, clean, run, generate javadocs, etc. However, my problem is that the source files in the packages, as well as the project itself, doesn't appear to be under version control in Eclipse. I can work with it fine from Cygwin, but not from the GUI.
The odd thing is that I have several regular Java projects, on the same repository which are synced fine by Eclipse, so it's not a version issue.
When I created the projects that work, I had to go to Team->Share Project... and Eclipse told me that they were already under version control and updated its configuration. However, in this current case, this isn't working. Any suggestion please?
EDIT:
I'm using svn 1.8.
UPDATE: I tried creating a regular Java project, and this time the version control looks fine, so it appears it's an issue related only to Java Project from Existing Ant build file.
The problem is that Eclipse doesn't know your project is using Subversion as a version control tool. You did a checkout outside of Eclipse, then you set up Eclipse as if this was a non-version controlled project.
To get Eclipse to recognize the project as under Subversion, you need to let Eclipse know. This means you should have said "File->New->Project, and select SVN->Checkout Project from SVN in the new project wizard. Then, Eclipse would have checked the project out in Subversion for you, and Eclipse would understand this project is in Subversion.
Unfortunately, I am not quite familiar enough with Eclipse to know how to tell Eclipse that the current project is really under version control. The best I could come up with was:
Right-click on the project and select Team->Share
Say this is a Subversion project you want to share.
Select the Repository to use
Select the folder where you want this project, and select the current folder.
You get the following warning:
Warning: The specified folder already exists in the repository. If you continue, that folder will be checked out to the existing location. Do you want to continue?
Your project will now be "checked out" over your current project. Everything should be okay because the files you have either match what is in Subversion or are modified versions of what is in Subversion.
You will be then asked to use the Synchronized view. Check "Yes", and then switch back to the Java view. Eclipse will now know your project is under Subversion and everything should work fine.
Note the use of Shoulds and Coulds. This is my way of saying that the advise given is done on an "as is" basis and I am not responsible for any damage done by following this advice, so please don't sue me.
It's basically your standard open source license.

import all projects from svn repository folder

I have that problem:
I checkout folder (myFolder for example) using tortoise svn.
import->existing projects into workspace
after it eclipse found a lot of projects(about 50) from different locations of myFolder.
BUT
eclipse doesn't understand that these projects from svn(no svn menu if make right click on any file and select team submenu)
I attempt to import-> team project set but after it in eclipse I see myfolder only. it is just folder - not projects. I cannot to compile it and use other features.
I think you are understand my problem.
Can you help me?
Make sure you have installed a subversion plugin for eclipse which is is compatible with the version you have for tortoise, i.e the eclipse plugin you actually have - if any - is able to read the .svn meta data which was created by the tortoise client. This can happen for example if eclipse plugin is 1.6 and tortoise client is 1.7 or above.
When eclipse shows the ~50 projects deselect all and select only the one(s) you want to import, when passed a folder for importing an existing project, eclipse searches recursively for all folders containing a .project file and displays them as projects to be imported. Make a refresh (F5).
EDIT
From http://tortoisesvn.net/tsvn_1.8_releasenotes.html#compatibility
Local Client Compatibility
Subversion working copies are sometimes accessed using several different clients, e.g. TortoiseSVN, AnkhSVN, and the svn command line client. Because the working copy format has changed with this release, 1.8 clients cannot access an earlier working copy without first upgrading it. Pre-1.8 clients cannot access 1.8 working copies at all and there is no downgrade option
Please upgrade your eclipse svn-kit to the latest version, use this update site.
If you have already checkout your projects, import them in eclipse then follow below steps.
Right click on your project go to Team --> Share Project --> Select Repository type. Do next fill in required information and it should work.

Netbeans there is a way to create an empty project?

I 'am a Visual Studio (VB.net / C#) programmer and I have installed Netbeans.
When I open a new project 'Java application' don't create a new EMPTY project but add the project to the other previous projects.
In Visual Studio (and all other IDEs) if I choose 'new project' after I see ONLY my new project and not all projects.
How can I do to create only a new empty project with Netbeans ?
P.S.
I don't want use Eclipse becouse I need a Visual Ide (form in particual) and Netbeans see better for this point.
Thank you !
In Tools-Plugins install Freeform project Extras.
Create
Java Free-form project or
empty Ant-based project or
Skeletal Ant-based project
Right click on the other projects and choose "Close Project"
Use:
File->Project Group->New Group...
There's no explicit form for doing that.
As a workaround you can create a project of any type according what you will want to do (Java, C++, PHP, HTML, etc), and then delete the resources created automatically except "nbproject" folder.
With this approach you have something similar to an empty project.
I recently used this trick for group some modules created for PrestaShop and then push them to Git VCS as if it were a single project, when actually each module is an independent project folder.

Eclipse. Restore project ".settings" directory

Accidentally I delete project ".settings" folder from directory where located Java project.
In this directory were located files like:
org.eclipse.jdt.core.prefs
org.eclipse.m2e.core.prefs
org.eclipse.wst.common.project.facet.core.xml
etc..
Can I restore them? Now eclipse show error when methods marked with #Override annotation (Eclipse don't understand that I implement some interfaces). It is not full list of errors.
Thanks!
i also had faced this issue once upon a time.
there is a solution for this.
Just delete the project from Eclipse workspace and import it again.
the settings will be created for the project.
Note: Don't delete it from Disk(it will ask for that when you try to
delete,so don't check the checkbox)
Unless you have a backup or generating your Eclipse project settings from some build system you should manually set your project preferences again in Eclipse (open project properties and look through the settings).
E,g, the problem with annotations is incorrect Java version setting for compiler (you need java 1.6 or higher).
Maybe your project is very simple then you may create new project with appropriate settings and copy your sources from broken project to new one.
If you want to avoid similar situation with workspace settings you may export them and backup resulting file (see file/export/general/preferences).
It is usually very convenient to generate Eclipse project from build configuration (e.g. all Maven, Gradle, Leiningen can do this). This works well unless you need some specific settings in Eclipse project that are not yet supported by build system.
It's needs lots of time. You should delete all eclipse files and import/create again this project. One time I have had some problem and I spent 3 hours for restoring. I tried restore using hdd recovery tools then manually checked some parameters. But in result I didn't fix all problems because in my case files was damaged.

Categories

Resources