How to build a downloaded a java source code in net-beans 6.9? - netbeans

I have downloaded source code from http://e-adventure.svn.sourceforge.net/viewvc/e-adventure/ .
How do I build it and run it in netbeans ?

There is a Compilation.txt file in the source code. You should read that and follow the directions. It says that it is an Eclipse project. Once you have followed the directions (notably downloading a jar file archive), you can try the:
File -> Import Project -> Eclipse Project
menu option and try and import it. Then, perhaps, it will build for you. I have not done this with an Eclipse project, so I don't know how well it works. It may well need some tweaking to get right.

Related

Open "gradle" project

I am an Android beginner and I downloaded the DisplayBitmaps project from the following link:
http://developer.android.com/training/displaying-bitmaps/index.html
It seems that there are no java files under the "src" folder but i find some codes under the folder "java" and a new item called "gradle".
I googled "gradle" and downloaded the eclipse plugin as suggested by the following link:
http://forums.gradle.org/gradle/topics/gradle-2-3-released
In Windows cmd, i have checked that gradle has been installed in my computer but i just don't know the next steps required in order to execute the project. I searched a long time and a bit confused by the solutions posted online.
It seems that gradle is q common but there are not many well documented tutorials on importing gradle into eclipse. It will be great if anyone would share some useful materials, many thanks in advance.
Install Gradle Eclipse plugin from this update site: http://dist.springsource.com/release/TOOLS/update/3.6.4.RELEASE/e4.4
(The update site is for Eclipse 4.4.x, put 4.5 at the end of URL if it's Eclipse 4.5 you are using)
Once installed import project as Gradle project. Don't forget to click on "Build Model" in the import wizard once you point to the right folder where the project to import is.
Once Gradle project is properly imported it'll have java nature applied to it and it'll have the appropriate folders...

How to use SVN to build a library

I am trying to follow a tutorial, and I am told to:
1- Get the source code for the Java EMV Reader library from http://code.google.com/p/javaemvreader/ and build it.
2- Drop the resulting jar file in lib/.
3- Import the project in Eclipse and build it.
I right click the java files, and choose run as but don't get an option to run as Java Application. I also can not export the files as a JAR file. I have enclosed an image of what I have
After the first comment, I right clicked on my project, and under Maven, chose the option "configure as Maven" project. ( Thank you so much; this must be one of the fastest resolutions in the world )And I can now run the project. I get the window in my pic2, which I have attached. I don't however know what step 2 of the above instructions means. I don't see a lib/ folder. And the project he is refering to in step 3 is on git. Any ideas on what he means? ![pic2]!1
Eclipse projects have a "type" and that controls what tools are available. You probably created a "Basic Project" which means there are no compilers or other Java tools associated with it. You would want to create a Java Project in Eclipse.
That project does not seem to have Eclipse .project and .classpath files checked into the repository. It does look to be a Maven project however. So you would either want the m2eclipse plugins installed, and check this out as a Maven project, which would handle configuring everything else, or you want to use the Checkout As ... option and use the wizard to create a new Java project to checkout.
These are more Eclipse IDE questions than SVN or Subclipse questions.

Eclipses code analysis doesn't work with git project

I have imported a git project into Eclipse
and I want to enable PyDev\Code Analysis\Pep8
but it doesn't seem to work...
I suppose it is because its a git project and not a project in the eclipse's workspace..
How can I make Pep8 code analysis work?
Try right click on the folder of cloned folder in Eclipse
PyDev -> Set as source Folder
Is becomes real eclipse project.
The reason for that is that PyDev will only do code-analysis on files which are under source folders (i.e.: in the project PYTHONPATH).
Please, read the Getting Started manual: http://www.pydev.org/manual_101_root.html which has a step-by-step on how to properly configure PyDev so that it works properly for you.

Why does my eclipse project not have a build path?

What is the advantage with not having a build path in eclipse? Why is that setting default when it's like something you'd never use? It seems eclipse indigo was developed to make software development as obscure as possible. I just checked out a fresh copy of the project I checked in (called dungeonworld) this afternoon from another computer and automatically nothing works, can't compile, can't choose build path, can't add jre, can't add jdk, can't add that to project properties.
Is my eclipse broken? I can't believe this is happening, such an easy thing not feasible.
Nothing above solutions worked for me so i tried below
Right click on project >> properties >> project facets >> click on java
It looks like you did not add Eclipse project metadata files to your source control system, so Eclipse doesn't know what your build path is or whether it is even a java project. You can see that the little folder on your dungeonworld project is missing the little 'j', which means Eclipse doesn't think it's a java project.
Go back to your other computer and look for the following files in your original project root...
.project
.classpath
.settings/*
Make sure all of the end up in your source control system or nothing will work right.
I have same problem, but i have solved
project right click -> properties -> java build path -> src/main/sources
all remove items on "Excluded", and then that item turn the status "(None)"
I tried below steps and it works for me.
Right click on project >> properties >> project facets >> click on java
Eclipse has a build path.
It's stored in a (by default hidden) .classpath file in your project.
You can also access it through the UI in project properties (right click on your project, properties, java build path).
Well, this is probably not your problem, but similar is happening if you are in Eclipse different perspective (for example for Python).
vs.
There where no entrys after right click on my projekt in Eclipse. How to click something, wenn build path entries are missing. So my Eclpise didn't detect my java project. I used following Maven command and after that I cleaned the project too. Now Projekt works as expected. So...
If you are using Maven, try mvn eclipse:eclipse in cmd console in your project directory! Make sure to use the path to your Maven folder for the command.
For example:
cd C:\yourEclipseProject\
C:\yourPathToMaven\apache-maven-2.2.1\bin\mvn eclipse:eclipse
This was helping me. After unsuccessful web research, a coworker told me this tip.
I just had a similar problem and I figured out that I had been choosing General Project instead of Java Project while creating a project. After I chose Java>Project it solved my problem. Maybe it'll solve yours as well.
After choosing that, eclipse automatically included java libraries as well.
It's not a good practice to commit IDE related files into source control. What if someone in team uses different IDE? It might have been only option at a time when OP asked this question.
New versions on eclipse (4.x) takes care of this automatically. Probably by observing what kind of source and build files you have in your project.
Don't know the reason. But this works for me, so posting it.
Right click on project -> 'Properties' -> 'Java Build Path'.

How do I open the GWT samples in eclipse Helios and GWT 2.1.1?

What is the straight-forward way of importing one of the GWT samples in eclipse Helios + GWT 2.1.1. It seems like the content of the zip file doesn't contain any project files for eclipse.
I tried the following:
create a GWT project 'bla'
Delete the src ad war folder and
replace it with the src and war
folder from the sample
refresh the project in eclipse
hit 'run'
[ERROR] Unable to find
'bla/bla.gwt.xml' on
your classpath; could be a typo, or
maybe you forgot to include a
classpath entry for source?
So I go to the run configuration and remove the path for the example projects from the arguments list. I also changed the name of hosted html page to the one in the sample. Hit 'run' and:
[ERROR] Invalid version number "2.0"
passed to external.gwtOnLoad(),
expected "2.1"; your hosted mode
bootstrap file may be out of date;
Now I need an out of date version of GWT to run these samples? What is going on, I just want to look at a sample to learn a new concept.
Reading the readme.txt in the GWT samples directory I came across a solution that works on Eclipse 3.7. Assuming you have ant installed on your machine, execute the following from the sample's directory:
ant eclipse.generate
This will generate both the .classpath and .project files needed to import the sample into Eclipse and run it.
Here the relevant excerpt from README.txt:
-- Option A: Import your project into Eclipse (recommended) --
If you use Eclipse, you can simply import the generated project into
Eclipse. We've tested against Eclipse 3.4 and 3.5. Later versions
will likely also work, earlier versions may not.
If the directory containing this file does not have a .classpath or
.project file, generate them by running 'ant eclipse.generate'
In Eclipse, go to the File menu and choose:
File -> Import... -> Existing Projects into Workspace
Browse to the directory containing this file, select "Mail".
Be sure to uncheck "Copy projects into workspace" if it is checked.
Click Finish. You can now browse the project in Eclipse.
To launch your web app in GWT development mode, go to the Run menu and
choose:
Run -> Open Debug Dialog...
Under Java Application, you should find a launch configuration
named "Mail". Select and click "Debug".
You can now use the built-in debugger to debug your web app in
development mode.
In eclipse 3.7, instead of Run -> Open Debug Dialog..., its Run -> Debug Configurations. I got both the showcase and mail samples running following those commands. Should work for all of the other samples as well.
The examples that come with GWT SDK were built in different ways. Some are Maven builds, others use Ant. Eclipse can handle these common builds directly, but you have to choose the right option.
So, if you want to open the Expenses project in eclipse, you would look in the projects root directory (i.e. ../gwt2.4/samples/Expenses) where you'll find a file called pom.xml. That is a Maven build file. To import it into your Work space select:
File->Import...
Open Maven->Existing Maven Projects, and click on Next > button
Browse your file system til you reach the Expenses folder. Click on it and Select OK.
At this point it will show you the Projects in that directory in the Projects: area of the window...only one in this case: /pom.xml com.google.gwt.sample.expenses:...etc.
click on the checkbox for that project, Next>
Finally, it ask you to map plugins. You'll need to select in the drop down menu under Actions the required plugins (such as m2e).
In other project folders you may find a build.xml file instead. That's an Ant build file. To import that you do something similar, but different (of course!):
File->New->Project...
Open the Java folder and select "Java Project from Existing Ant Buildfile", Next >
Click the Browse button, dig through your directory to the project folder and select the build.xml file, and Open it.
Project name should fill in automatically, just select the declaration to use in the middle window and click Finish.
Since those tutorial only include the src and war directory, the idea remains to:
create a new project following this tutorial
remove any created class part of the example files which are automatically added (see Issue 1547)
Unfortunately the Google Plugin does not allow to created a new Web Application Project without creating template files. The template files are nice for the first try but annoying if you want to start from scratch with a new GWT application.
copy the src and war directory in place within the now empty project
Following your ticket 5847 (No easy and straight-forward way to make examples work in eclipse),
as xo4yhamope comments, you need the right GWT option.
and did you consider the Issue 5038 about the error message:
Unable to find 'xxxx.gwt.xml' on your classpath;
could be a typo, or maybe you forgot to include a classpath entry for source?
This message usually means you attempted to refresh the browser before dev mode has had a chance to finish loading the module.
The uppercase/lowercase confusion happens because the module has been renamed to 'stockwatcher', but dev mode cannot map 'stockwatcher' to "StockWatcher' until it has finished loading the entire module.
So, it's just a matter of waiting a few seconds longer after the Development Mode pane says I should go to http://127.0.0.1:8888/StockWatcher.html?gwt.codesvr=127.0.0.1:9997 ?
That seems a little messed up. It should wait until it's actually ready before telling me it's ok, because users (like me) are going to go there as soon as the UI says it's ready.
The other confusing part is that the server begins serving the host page as soon as that message in the UI comes up. Because this was happening, I assumed that the server was completely up, even though (as it turns out) it wasn't.
Anyway, waiting a few more seconds seems to resolve the "Unable to find 'stockwatcher.gwt.xml' on your classpath" problem. Thanks!
I'm beginning to suspect this is a bug in the samples. I am adding this answer so it can be marked as an answer when I get confirmation about that.
I was trying out some other samples and came across this page. At the top is a little explanation for how to download and import the sample.
Before you begin
The StockWatcher project
This tutorial builds on the GWT
concepts and the StockWatcher
application created in the Build a
Sample GWT Application tutorial.
If you have not completed the Build a
Sample GWT Application tutorial and
are familiar with basic GWT concepts,
you can import the StockWatcher
project as coded to this point.
Download the StockWatcher project.
Unzip the file.
Import the project into Eclipse
From the File menu, select the Import... menu option.
Select the import source General > Existing Projects into
Workspace. Click the Next button.
For the root directory, browse to and select the StockWatcher
directory (from the unzipped file).
Click the Finish button.
If you are using ant, edit the
gwt.sdk property in
StockWatcher/build.xml to point to
where you unzipped GWT.
Now this is what I call straight-forward and easy.
At that point I had already built the StockWatcher in a previous tutorial but I got intrigued by the fact that it was explained exactly as I tried it the first time. So I downloaded the project and it had the correct eclipse project structure. I tried to import it 'et voila' I have the project in eclipse. I runs out of the box (with warnings). That is how expected the samples to be.
This experience leads me into thinking that the sample projects are malformed (as eclipse projects) and need to be updated. Let's hope my issue report leads to results.
-- Option A: Import your project into Eclipse (recommended) --
If you use Eclipse, you can simply import the generated project into Eclipse.
We've tested against Eclipse 3.4 and 3.5. Later versions will likely also
work, earlier versions may not.
If the directory containing this file does not have a .classpath or .project
file, generate them by running 'ant eclipse.generate'
In Eclipse, go to the File menu and choose:
File -> Import... -> Existing Projects into Workspace
Browse to the directory containing this file,
select "Mail".
Be sure to uncheck "Copy projects into workspace" if it is checked.
Click Finish.
You can now browse the project in Eclipse.
Copy from readme.txt supplied by samples. I tried this method, it's OK.
To import GWT showcase(2.5.1) I did following steps:
Create a new Google Web Application Project
New –> Other –> Google –> Web Application Project
Provide the project name “Showcase” and the Package name is com.google.gwt.sample.showcase
Click Finish
Go to eclipse plugin folder and traverse to the gwt
Under that folder go to gwt-2.3.\samples\Showcase
Copy (Ctrl C) all the contents. The contents are
a. src
b. test
c. war
d. build.xml
e. README.txt
In the eclipse, right click on the Showcase project and paste. Overwrite all the files
The files should start copying without any problem
Right click on the Showcase and Run As “Web Application”
You should have your Showcase working like Gem!
For me it worked like a charm ;)
Ref : http://simplestepswebdev.wordpress.com/2011/05/16/import-gwt-samples-into-eclipse/