I would like to know why, after running on my console:
java -jar jenkins.war
and going after the installation process, I can't access the jenkins configuration dir in the same dir as the war file. Where should I look this dir in case I wanna backup ?.
Default location for Jenkins on a Windows machine is C:\Users\<USERNAME>\.jenkins. You can specify this location by specifying JENKINS_HOME, like this:
java -DJENKINS_HOME=C:\path\to\jenkins\home -jar jenkins.war
Related
I am starting AEM in publish mode using the quickstart jar:
java -jar cq-publish-p4506.jar
Under the crx-quickstart directory, i see only one directory, repository. There is no bin directory created under it
crx-quickstart/
repository/
What can i do to make AEM create the bin directory with start/stop scripts?
Run
java -jar <CQ_JAR_PATH> -unpack -v
This will extract for you.
Then edit the start or quickstart files to set the run mode to publish and port to 4506.
You can then use the start/stop/quickstart scripts to start AEM.
The bin directory is under crx-quickstart, not under repository.
I successfully created a custom URL protocol in Windows following this instructions that targets a simple jar that I created, I can run this jar manually by executing this command (java is in the PATH):
java -jar test.jar
But when I open an URL that uses my custom protocol, it doesn't execute the jar, the protocol is supposed to execute the same command, this is how it looks in the Registry Editor:
"C:\Program Files\Java\jdk1.8.0_152\bin\java.exe -jar C:\testFolder\test.jar" "%1"
If I replace the jar with an .exe file it works fine, for example notepad.exe or the calculator, so the problem is executing the jar.
"C:\Program Files\Java\jre1.8.0_202\bin\java.exe" "-jar" "C:\Users\user\Desktop\DisplayStartArgumentsInFrame.jar" "%1"
Is the required command in the registry entry. I was also trying around with url protocols and had the same problem. I don't know why, but it works.
Edit: use javaw.exe instead of java.exe to suppress the terminal.
I'm trying to deploy a .ear file to my test environment using Jenkins.
The web application is running on Bea Weblogic 9.2, so i though the easiest way to do this is just execute the following script in the post build steps (add post buils steps--->execute shell):
java weblogic.Deployer -adminurl t3://22.33.44.55:8001 -username myUserName -password myPassword -deploy -name earfilename -targets AdminServer -source C:\apps\sample.ear
Assuming that this will work, i'm sure you will agree with me that this does not make sense bacause the -source is pointing at my local ear. I want instead to deploy the ear file that was just builded from jenkins (which is the result of the SVN commit).
So my final question is: is there any environment variable i can put in my script to get the -source (path to the ear just builded) and -name (the name of the artifact changes with each version)?
Thanks in advance
source parameter doesnt need to have the filename with it, it should be C:\apps\ and put name as the application name. you can also add a one liner command to remove the already existing apps before the new build is created so that apps folder only has one file. If the ear file resides in a remote server use -remote option with the command.
e.g
java -cp $CLASSPATH weblogic.Deployer -adminurl ADMIN_URL:PORT -username weblogic -password weblogic1! -distribute app.war -name appname -targets AdminServer -debug
-usenonexclusivelock
you can also check the name of ear file with find command, store it in a variable and use that variable in the command.
I'd like to put the yuicompressor jar file in a single folder so that I can call
java -jar yuicompressor-2.4.2.jar ...
from anywhere on my system, with cygwin. For bash files I use I simply put them in a common folder, and added the folder's path to my windows user's PATH environment variable and the bash commands were found in cygwin.
when I echo $PATH I see the folder I put the yuicompressor jar into listed in the $PATH..
But when I try java -jar yuicompressor-x.y.z.jar myfile.js -o myfile-min.js (for example) I get the following error message:
Unable to access jarfile yuicompressor-2.4.2.jar
Even when I try providing an absolute path to the jarfile I get the same error message..
How can I do this?
The PATH environment variable is a list of directories the shell will search through in an attempt to run a command.
java.exe will not search the directories on the PATH environment variable to try and locate the archive you are attempting to run. So running java -jar yuicompressor-2.4.2.jar from any directory other than the one containing the archive would be expected to fail.
What is the full command you are attempting when providing an absolute path?
Can the Jetty server run on Windows-based environments. If there is a Windows installable, can someone please point me to it?
I found a good tutorial and the quick start documentation on the installation of Jetty in a windows environment. It's not simply an installer, but you merely unzip the files into a folder and run the command:
java -jar start.jar
in the folder where you unzipped it to start the server.
Jetty downloads
Reference: Jetty Quick Start
Updated:
1 – Downloading
You can download Jetty from two sources: Eclipse or Codehaus.
http://jetty.codehaus.org/jetty/
http://www.eclipse.org/jetty/downloads.php
2 - Simply uncompress the file to a directory.
3 – Running Jetty
Open a terminal.
Go to the Jetty installation directory.
Enter the following command:
$ java -jar start.jar
Now open a browser and go to localhost to check if Jetty was installed sucessfully:
http://localhost:8080/
In case you have jar file created by maven and has all the dependencies you will require following command.
java -jar XXX.SNAPSHOT.jar server config.yml
You can make your own XML based configuration file and pass it along with the startup command:
java -jar start.jar /path/to/jetty.xml
For example, if you want to use something else than 8080, then just put jetty.port inside the jetty.xml:
<Set name="port"><Property name="jetty.http.port" deprecated="jetty.port" default="9090" /></Set>
Or those who are impatient, can just start up their instance with:
java -jar start.jar --module=http jetty.port=9090
If you'r using Jetty version 9.x. You need to go to $JETTY_HOME/start.ini file and edit this setting jetty.http.port.
jetty.http.port=9090