I've created a rest server with compojure and ring.
I can run it with 'lein ring server'. I can build it with 'lein uberjar'. But how to run this jar like java -jar my.jar ...?
You need to invoke lein ring uberjar to generate a self-start server you can run with
java -jar target/uberjar/yourproject-0.1.0-SNAPSHOT-standalone.jar
I suggest you to use the standalone one to avoid dealing with dependencies
Edited to include the specific command
Related
I am new to Spring batch and want to run a batch with a command line using CommandLineJobRunner class, So I copied the generated jar file and CommandLineJobRunner to my Desktop and after I ran the following command:
Java -cp spring-batch-example.jar org.springframework.batch.core.launch. support. CommandLineJobRunner classpath: /jobs/file-import-job. xml simpleFileImportJob
which give this error (impossible to find or load main org. springframework. batch. core. launch. support. CommandLineJobRunner).
I think that I should deal with the classpath, I don't know how doing it.
You need to add Spring Batch jars to the classpath too, something like:
java -cp spring-batch-example.jar:lib/* org.springframework.batch.core.launch.support.CommandLineJobRunner classpath:/jobs/file-import-job.xml simpleFileImportJob
where lib contains Spring Batch jars and their dependencies. Note that if you are on windows, you need to use ';' instead of ':' to separate classpath entries.
I recommend to use maven shade plugin or a similar plugin to create an uber jar, or use Spring Boot and it will do it for you. In both cases, you would be able to run your job with:
java -jar spring-batch-example.jar
I'm running weblogic in unix, I would like to automated processes by executing tasks in the command line, for example i would like to update a deployed project without the need of accessing the weblogic console, rather i would want to run a command that will do the job, so my initial challenge is, how do i run "Lock and Edit" in the command line? or i should ask, what is the console doing behind the scene when I'm running "Lock and Edit" ?
To deploy/undeploy application from the command line, you can use the weblogic.Deployer class. See that documentation for details.
WebLogic Server has its own scripting language based on Jython (python in a JVM) you can use to computerize any configuration action. WLST is described in this documentation.
When you do lock and edit it creates a nonexclusive lock to the domain and same can be achieved with command line as below:
Generate a client jar from weblogic using below:
Change directories to the server/lib directory.
cd WL_HOME/server/lib
Use the following command to create wlfullclient.jar in the server/lib directory:
java -jar ../../modules/com.bea.core.jarbuilder_X.X.X.X.jar
where X.X.X.X is the version number of the jarbuilder module in the WL_HOME/server/lib directory.
For example:
java -jar ../../../modules/com.bea.core.jarbuilder_1.0.1.0.jar
You can now copy and bundle the wlfullclient.jar with client applications.
Add the wlfullclient.jar to the client application’s classpath.
once this is done use the below command to automate the deployment:
export CLASSPATH='location where your client jar resides'
java -cp $CLASSPATH weblogic.Deployer -adminurl ADMIN_URL:PORT -username weblogic -password weblogic1! -deploy app.war -name appname -targets AdminServer -debug - usenonexclusivelock
I am using javafxpackager to deploy a javaFX application, but it only generates a deb package, the command line I am using is this:
javafxpackager -deploy -native -outdir packages -outfile DebtRegister -srcdir out/artifacts/DebtRegister2_jar -srcfiles DebtRegister2.jar -appclass application.Main
I am using ubuntu and I do not wish to use windows for packaging.
Where is the mistake in my command?
First please note that the javafxpackager has been renamed to javapackager.
Regarding your question, please see the documentation:
all: Runs all of the installers for the platform on which it is
running, and creates a disk image for the application.
You will have to run javapackager on every supported platform.
I have my Java project in a Hg repository. How can I use this code or convert to Git repo to be able to deploy on Cloud Control?
Is there an Option for me to use a .war file to Deploy instead of the entire file structure upload and compile? If so, would it matter if the war file was built using Tomcat server or Glass-fish server?
Your help in answering these question will be a valuable information for me. Appreciate your help in advance.
Best Regards.
If you want to keep all mercurial branches, tags and history use fast-export. Otherwise just create git repository from scratch:
git init; git add . ; git commit -am "Initial commit"
Deploying prebuilt war file is not the recommended way. You should push to the repository (via git or cctrlapp) and let cloudControl platform take care of the build process. Anyway you can still use Maven to download the war file. You can find some examples here.
Apart from this you have to provide an embedded jetty or tomcat runner and specify start command in Procfile:
Jetty:
web: java -jar target/dependency/jetty-runner.jar --port $PORT target/YOU_WAR.war
Tomcat:
web: java -jar target/dependency/webapp-runner.jar --port $PORT target/YOUR_WAR.war
Keep in mind that war file should be built independently of any application servers.
I have created a project within NetBeans with includes a form and a class that serves as a database connection layer. When i try to run this project through the IDE everything launches just fine. The problem occurs when i try to launch the jar file created by the ide on the commmand prompt terminal. nothing happens? it just moves to the next line. i have a manifest file with a class path and main class specified and it looks like so
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.3
Created-By: 1.6.0_22-b04 (Sun Microsystems Inc.)
Class-Path: lib/mysql-connector-java-5.1.13-bin.jar lib/mylib.jar
X-COMMENT: Main-Class will be added automatically by build
Main-Class: eopprototype.EOPPrototype
when i look at what the compiler says is says To run this application from the command line without Ant, try:
java -jar "/h/USERS/local/pagola/NetBeansProjects/EOPPrototype/dist/EOPPrototype.jar"
when i try to type that command it just goes to the second line without anything happening. Not evena ny errors. I am supposed to distribute this jar file to a shared folder and have it run but i cant do it and i dont know whats wrong. I have NOT added any JAVA_HOME path as my jdk 1,6 is isntalled in usr/bin so it should find it there but i have NOT added any classpath (ide shows two runtime and bootable classpaths) somebody please assist me as i am new to the whole java virtual machine environment
I guess you meant the standard outputs, or other things you printed to the command prompt from your java program. To get that printed on the command propmt, you need to run java in debug mode.
Use
java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -jar myJar.jar
to run java in debug mode and get all standard outputs, exceptions etc. on the command prompt.