Build EAR in Eclipse Indigo - eclipse

i created an EAR-Application in Eclipse Indigo and compile it via "run on server". All works well but i dont see the compile errors in the console. How can i make it visible?
Is where any way to compile an ear without having an AS running?
thx
BJ

Your code is compiled in the background, not when you invoke "run on server". To see compilation problems, you need to look in the Problems View rather than the console. If the Problems View is not visible in your current perspective, use "Window -> Show View" menu to find it.
To create a .ear file, you can use the "File -> Export -> Java EE -> EAR file" wizard.

Related

Ant buid clears eclipse console - how to stop?

whenever I do an ant build, my console results (Errors, warnings etc.) are deleted and it always Shows
"BUILD SUCCESSFUL
Total time: xxx milliseconds"
how can I prevent the ant file from overwriting my actual console Output?
thank you!
you can try this:
open "External Tools Configuration" (in my eclipse-ui its next to the green run button in the menu bar) -> open your ant runconfig -> go to "common" -> disable "Allocate console (necessary for input)"
this should prevent the overwriting of the console.
in my eclipse version (eclipse mars rc2) it leads to the situation that the current console is closed, but no ant console opens....i think this behaviour is not intended (maybe an eclipse bug). so its the half way to a solution: no ant output but still a deleted console output.
Maybe it works for your eclipse version
greetings

Run as Ant build' Missing in my eclipse

I am unable to right click and run my build.xml file by choosing 'Run as Ant' . Whenever I click it says run configuration and that goes into running Java file options .
This works for me.
Go to..
1. Help -> Install New SoftWare
Work With -> "http://download.eclipse.org/releases/juno"
Drop down list "General Purpose Tools"
select "Eclipse Plug-in Development Environment"
After doing this...eclipse started showing option of Ant Build in Run as
In Eclipse Neon, the Ant Build moved to Run > External Tools > External Tools Configurations ... it is not located in the default Run anymore.
An example of a build xml file and how to run it
I hope this helps!
I encountered a configuration where depending on the filename of build.xml file the "Run As" menu did not contain the "Ant Build" and "Ant Build..." commands. The commands "Ant Build" and "Ant Build..." (see the image in ricardoramos's answer) are present if the build file is named build.xml, but absent if the file is named build-something.xml.
I tracked down that the cause of this issue in my configuration was plugin LiClipseText. Uninstalling the plugin resolved the issue. I observed this with LiClipseText version 2.1.2 and with Eclipse versions "2018-09" (4.9), "Photon" (4.8) for Java EE Developers.
The plugin provides its own editor for XML files, and I guess that interferes with the way how Eclipse detects that an XML file is an Ant build file.
It may be that this will be fixed in a future version of LiClipseText.
For a recipe on how to uninstall the plugin - see question 6174725. For a cleanup afterwards - see question 221476.
Another possibility is your build.xml file is not parseable by ant
For example, if you open the Ant Perspective (Open Perspective | Other | ant) and then choose the Add Buildfiles toolbar button, then choose your build.xml file, if it is not a valid build file, you may see an error message "Unable to parse as an ant build file".
Once you fix your build.xml file, the Run As ant RMB command on the build.xml file will appear.
(above was my experience on Eclipse Mars.2)
Follow the below steps.
Go to Windows -> Preferences -> General -> Content Types -> Text -> XML -> Ant BuildFile.
Just click on Add button and add your AntBuild file. click ok.
Restart your Eclipse.
Follow the below steps.
Go to Windows -> Preferences -> General -> Content Types -> Text -> XML -> Ant BuildFile.
Just click on Add button and add your AntBuild file. click ok.
Workaround:
Open the ANT-View, add the build file and start it from there.
(Had the problem in JBDS8 after installing IBM Diagnostics Tools)

java file within Maven project no longer has "run as java application" option

I have a java file within a Maven project that I used to get the "run as java application" option on. I re-imported the code from SVN as it seemed something might have been corrupted. I can compile and create a .war file, but I can't seem to get the "run as java application" option back. I tried going into run configurations, but when I put my Maven project name into the project it says i'm trying to reference a non-existing project. In my Maven project, it says the type is a project, so I'm wondering why it's not showing up in the project list.
And how do I get the "run as java application" option back? I haven't changed the .java file at all since the last time it worked. It has the necessary public static void main, so i'm not sure what else to try.
Thanks in advance for any help!

Using Eclipse, how can i tell what version of ANT is being used?

Same as original question, using Eclipse, how can i tell what version of ANT it is configured to use?
In Eclipse Helios:
Open the Preferences dialog (Window -> Preferences)
Navigate to the Ant -> Runtime page
Expand the Ant Home Entries node on the Classpath tab
This shows the path used for Ant classpath, which also reveals ANT_HOME for Eclipse.
So by default in Helios you will have something like:
<ECLIPSE_ROOT>/plugins/org.apache.ant_1.7.1.v20100518-1145\lib\ant.jar
etc
On this same page, you can also change ANT_HOME to use a different version of Ant you have installed on your PC.
Create a build file and echo $ant.version
On Helios
create an empty build.xml
ctrl+space in the empty file and select the default build file template with 2 targets
in the target called "default" add <echo>${ant.version}</echo>
save the file
right click on the build.xml in the navigator
select run as ant build
In Eclipse Helios (version 3.6.2) the version of the various plug-in modules such as ANT can be determined in the following manner.
Select the Help -> "About Eclipse SDK" menu option
Click on the "Installation Details" button
Click on the "Plug-ins" Tab
The "Plug-in Name" column is where ANT can be found the version is in the next column.
There will probably be multiple references to ANT in the "Plug-in Name" column including
Ant Build Tool Core
Ant Launching support
Ant UI
Apache Ant
I believe the "Apache Ant" is the most relevant entry and the others deal with how ant integrates with eclipse.

Eclipse "Waiting for virtual machine to exit"

I'm working on a blackberry project using eclipse and bb-ant tools. I've created a build.xml file to perform the build. Everytime I try to run an Ant build, eclipse pops up the progress dialog and it hangs stating "Waiting for virtual machine to exit."
I downloaded an open source Blackberry project that has an ant build and it is showing the same behavior.
Does anyone have any suggestions?
Edit:
I used the command line to build my xml file and it built fine. However, when I tried from Eclipse it still hangs.
I've tried both the standard eclipse plugin directory and the path I downloaded ant to.
You could check if your ANT_HOME settings are correct (see also this blog post).
"Window > Preference > Ant > Runtime": "Ant Home Entries".
if the jars files are from a plugin directory (beside the default 'org.apache.ant_1.7.1.v20090120-1145' one) and not an independent ant installation, that might explain the problem.
Try clicking the "Ant Home" button on the right side and setting up ant home such as "C:\path\to\apache-ant-1.7.0"
There are similar bugs to this kind of situation (bug 173419, ticket 91).
It is worth checking the JVM used for the project.
It can also occurs when a ant task is poorly implemented.
You had the problem because the java version ant tries to run with is incorrect.
By default, eclipse will try to run the ant build with the java version it uses to compile the java files (Blackberry JRE), which won't work! You need to change the jre version by choosing "Run As... > Ant build". Before clicking run, go to the JRE tab, choose "Separate JRE:" and change "Blackberry JRE " to a standard java JRE. Press the run button and everything should work correctly.
I hit this problem also. Although I never used the same solution, you pointed me in the same direction.
I was using a ant file as a builder in my project, and I disabled the Allocate Console build option. This is when I hit the 'Waiting for virtual machine to exit'.
So I simply enabled the Launch in background option and it worked.