TO Use Cygwin within Eclipse 3.6 - java

I'm working in J2EE application. We are developing application in java/j2ee. In our project we use cygwin to simulate linux os, run shell script included in application and to deploy. How to use eclipse to embed eclipse and cygwin and deloy in run/debug mode.
Am new to this kind of stuff and confused to how to proceed further. Please suggest me how to proceed with this.
Thanks in advance.
Appreciated for guiding...
We r developing j2ee project in window env. and deploying in linux server.
so to simulate linux in windows we use cygwin.
Now we use eclipse to develop and get into cmd prompt and start cygwin and then run basic shell script to initialize variables and build the project and deploy the EAR in linux server ...
For these two purpose i have to toggle the window and i couldn't debug the code and check for check time data.
Is there any possibility to merge cygwin with eclipse to start the server or in run in debug mode, so that my developement process would be efficient and easy to code walk through... My enter team is following the first process which may tedious work.
Can any one suggest to work efficient with this project
Thanks in advance

Don't use shell scripts for your deployment process. Maven almost certainly has plugins for everything your shell scripts are currently doing, and it runs on Windows and Linux transparently.

Related

Which java server to run a jar application?

I made a java program which runs unit test on my website.
I need the unit test to keep running during the day while I watch the log.
For this, I search a java platform on which I can run my soft. Openshift will be the best because it's easy to install and maintain.
However I will often modify this soft and if the java project could be built whenever I made a commit it will be the best. That's why I think to Jenkins, but I don't know if it is a good way to run a jar from a jenkins server whereas it is made to do build.
I tried JBoss and tomcat by wrapping my programs into an Enterprise Application Client but I can not run and check the log of the program from a web interface.
Currently my project is a Java Application, using MySQL, hibernate, maven and git.
What would be the best option for you ?
Thanks.
Florian C.
Finally, here is my soluce.
I use Jenkins.
When I push on Jenkins, my project is automatically built and ran using a shell script.
If the build or the run fails Jenkins sends me the command output by mail.
Else, every day, the project is run (using the cron of jenkins) and the console output is sent to me by mail, so I can check the result of my test.

Programmatically stop and start JBoss in Eclipse

Is it possible to programmatically start and stop JBoss in Eclipse? I am using Indigo Eclipse Java EE, I have a JBoss 5.1.0.GA server that I manually start/stop in Eclipse.
I want to automate restarting the server (as part of a test procedure to restart the server to reflect changes in the database). Is there some library that I can use to do this, or some other way of accomplishing this?
Create a .bat or .sh file (depending on the OS your JBoss instance is installed) with a script that executes the shutdown (bat or sh) and then the run (bat or sh). There's no need to use Java or any other programming language for this.
Still, if you really want to do this using Java, you can use one of the approaches (again, depending on the OS):
Batch files:
How do I run a batch file from my Java Application?
Shell files:
Java - Execute a .SH file
Running .sh files with Java's exec in a different directory?
Just note that the run and stop scripts files are in [JBoss_install_path]/bin

Java: How do you debug a module/jar that works as a plugin for another application

I know this sounds like a pathetic question and I'm sure it will get ridiculed but thats the only way I know how to describe the situation.
Scenerio : I'm creating a plugin for another java application. This application that uses the compile jar (my plugin) gets placed in the applications plugin directory. Is there anyway I can go about debugging this jar (which I have to source to) in execution of an application I do not have the source to?
I'm using Eclispe Juno as my IDE.
I would say yes, if you can start the application that you plugin plugs in into :).
java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=n myapp
to start then in eclipse setup a remote-debugging session setting it up to connect to your app running in the java debug mode to the localhost on the port 4000
This linky will probably solve all your eclipse problems
http://javarevisited.blogspot.com/2011/02/how-to-setup-remote-debugging-in.html

Can I run the jetty-maven-plugin from within Eclipse?

We're debugging java webapps, and would like to use the jetty-maven-plugin to launch a Jetty server. All of the documentation I have seen suggests that you should do it from the command line, which makes debugging and setting breakpoints in Eclipse difficult. Plus I'd like to see the output in the console window and be able to stop the process with red button. And do profiling as well.
Anyone know how to do this?
Yes, if you have m2eclipse installed then just enter in "jetty:run" as the goal you want to run.
You can however connect Eclipse's (or any IDE's) debugger to a running Jetty instance by launching the jetty plugin with the JPDA flags, without having to execute from within Eclipse.

Can I set up arbitrary commands in an Eclipse Java project run configuration?

I have a Java Eclipse project, but I don't run it from the command line using java.exe. Instead I run it through a python script that runs the java.
What I'd like to do is run this when I hit the 'Run' button in eclipse and see the output in Eclipse's console window. Unfortunately the available run configuration options available are a little too restrictive and don't seem to allow for this arbitrary 'run anything you like' configuration.
Is this possible? Are there any eclipse plugins that add this kind of configuration option?
I realise I'd probably lose debugger support, but this is not an issue for me.
You could run it through an "external Tools Configuration": it can call any script/command you like, even if that script launches itself your Java program.
(source: abdevelopment.ca)
Then, once it is launched, you can initiate a remote debug session, provided your script did launch the Java program with the right options
-Djava.compiler=NONE -Xnoagent -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
alt text http://www.nakov.com/blog/wp-content/uploads/2008/08/eclipse-remote-debug-configuration.png

Categories