How to create a executable Jar file for the Groovy script developed using Eclipse IDE - eclipse

I have developed groovy script to run the Automation Testing using Eclipse IDE. The code generally triggers the Web service based on the input and Validates the responses.
I have exported the jar file by right clicking the project. The jar file is created.
But when I try to run the jar using Command prompt I am facing an error.
Can anyone please help me how to create a executable jar for the Groovy script

Related

Install4j - embedding jar into generated launcher

I have 'generated launcher' which executes my java application - aplication is in jar package.
Is there any way how to include jar into generated EXE file(launcher)? Customer wants to have only exe file, not jar in installed folder. Is there any way how to do it?
There is no way to do that with install4j. You can do it with exe4j, by using the "JAR in EXE" mode and add the generated executable to the distribution tree instead of using the generated launcher. This only works for Windows, though.

Best method to export the Eclipse project as exe file

I have a selenium project in eclipse that i want to distribute to manual testers with no Eclipse or Java knowledge. Hence i am looking to distribute it to them as executable files so that they dont need to use eclipse to run them. Can any one suggest the best way to do this without having to install any 3rd party extensions?
P.S : My organisation doesnt allow me to install 3rd party extensions on Eclipse. It will require a lot of approvals. Hence i am wondering if there is any method available inside Eclipse itself?
I've done it some years ago, in my eclipse version:
file -> export -> java -> Runnable jar file
If you want an exe file you can use: Launch4J
Export your project as jar file and create a .bat file which will include all the necessary libraries in your classpath with your project and then make a call to the underlying script (in case if you are using testng then testng has option to make command line calls)
else use Maven
EDIT:
Something on below lines:
1. Create run.bat file
2. Content of the bat file:
JAVA_HOME={Path to your JDK}
CLASSPATH=%PATH%;{All the dependent jar files of your project as well as you project}
{Call to your Junit Script from command line} Something like this Run JUnit from command line
3. Run your batch file (run.bat)
I may not have provided the exact code but thats where you should be heading if you wish to run your JUnit tests from command line.
NOTE / FYI : Maven does not require any installation or approval..You just download the zip and unzip it and set environment variable and thats it.

How to run mapreduce jar using eclipse

I am trying to use eclipse (Kepler) for building, running MapReduce (ver 2), using maven plugin.
I am able to successfully build the project, and i see that maven created jar file as final output, suppose that jar is -> mapreducedemo.jar.
Now, my question is how to run this jar using eclipse?
I tried it on command prompt and it works fine, like this:
--> $ hadoop jar mapreducedemo.jar MainDriver input output.
The thing is hadoop is shell script and it sets all the env variables internally, and required jars.
How can we run this mapreducedemo.jar using eclipse?
Any answers would be great help.
Thanks,
Vipin
You should be able to just run MainDriver as a java application from within Eclipse. Maven will make sure you have all your dependencies and MainDriver, once it configures the job will submit it for execution, just as it does when you run the hadoop jar command.

Running GWT application in production mode

I am newbie to GWT. I have built gwt maven project. To run in development mode, I first compiled project Google|Compile Project, then from command mvn gwt:run, it runs fine on
http://localhost:8888/index.html?gwt.codesvr=127.0.0.1:9997
but for production I want to access module
http://localhost:8888/index.html
When I omit gwt.codesvr= argument, I am getting error "gwt module may need to be recompiled". After Recompiling, I get the same error. Any help/pointer?
Thanks,
i run gwt project on tomcat on production mode. Jetty cant show it. Try to tun with external web module. When you are look at the IDE console title show us 'Development Mode'. Tyr with external , in any exception i can help.
You did it correctly, but as the error states, the module needs to be re-compiled (GWT Compiled). Once recompiled, Force your browser to reload (Ctrl + F5). If that doesn't work, you can look at this answer I wrote regarding cleanup of compiled output. Do what's listed there, and try running GWT compile again.
To run production mode outside Eclipse, you must do a GWT compile and create a WAR file, which you can then deploy on a Java application server such as Tomcat. This process is much easier with an ant build script.
To make an ant build script for your project:
You can easily create an ant build script by running the webAppCreator command from the directory where the GWT library is installed. That command will create a sample project just like clicking "New Web Application Project" in Eclipse, except it will also make a build.xml file.
You can run it in Eclipse by right clicking build.xml > Run As... > Ant build. By default it will run the build target. It also has a war target, which you can run to create a WAR file.
For more details on the webAppCreator, look here.

Deploy a selenium test project in eclipse that uses ant build file to run

I have a testing project that uses selenium RC and is currently on eclipse. I run the selenium test scripts and generate report using ant build file in eclipse only.
I want to deploy my project in executable file such that i don't need eclipse to run my project. It can be .jar file or .bat file. preferably .bat file; so that i can run it from command line.
Also, in case of bat file, will the other PC executing the executable will need any additional setup?
Is there any plugin for eclipse through which it can be achieved?
Well, I was doing something like this.
You should:
have mozilla executable in your path
launch java.exe from .bat file this way:
java.exe -cp ./production/;./lib/* package.MainClass
./production should contain your compiled classes and libs should contain all jars. You may also pack your app into a jar file, this is described here: http://docs.oracle.com/javase/tutorial/deployment/jar/build.html