Jetty server for Windows - windows

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

Related

AEM Publisher 6.5 - No bin Directory

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.

No main manifest attribute found in Corda Standalone Shell jar of Corda Enterprise v4.0

I want to evaluate Corda Standalone Shell of Corda Enterprise v4.0.
I have downloaded corda-shell-4.0.jar from below URL
https://www.r3.com/corda-enterprise-download/
And refering to below document
https://docs.corda.r3.com/releases/4.0/shell.html?highlight=standalone%20shell#the-standalone-shell I am analysing the Standalone Shell and when I run java -jar corda-shell-4.0.jar command then I get the following error:
no main manifest attribute, in corda-shell/corda-shell-4.0.jar
When I checked the MANIFEST.MF file then there is no Main-Class specified in the Manifest file.
Can anyone please guide me how to use the standalone shell?
Have a read of this - https://docs.corda.r3.com/releases/4.0/cli-application-shell-extensions.html .
It the jar is not meant to be run via java -jar. Instead, you install the CLI commands and need to set up some config to get it all to work.

Unable to start Spring Boot executable jar using IBM JRE 1.8

We have a Spring Boot application which is built as an executable jar and runs fine using both the Oracle and OpenJDK JREs (using 1.8 versions).
Attempting to run it using the IBM 1.8 JRE however results in the following error at the command line.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
This occurs if we execute the jar (using ./application.jar) or using java -jar application.jar
This led us to change the packaging to not make the jar executable and this allows us to start the application using java -jar application.jar. So it appears the IBM JRE doesn't like the launch script.
The problem is we don't want to have two packaging methods for different deployment environments, if possible.
Does anyone have any experience of why the IBM JRE doesn't like the script on the front of the jar file and whether there are any command line options to disable whatever checking its doing?
From your post it is unclear if you have problem with
1) running jar from Linux like chmod a+x application.jar and executing
Or
2) running via /opt/IBM/java/jre/bin/java -jar application.jar
For option 1) it is not a good idea as you do not explicitly choose jvm binary and rely on OS to choose one for you.
Read about binfmt_misc mechanism:
https://en.m.wikipedia.org/wiki/Binfmt_misc
For option 2)-it might be class loading problem, please add
/opt/IBM/java/jre/bin/java -verbose:class -jar application.jar
and consult documentation here: https://www.ibm.com/developerworks/library/j-dclp1/index.html

can't access jenkins configuration file dir

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

Start Equinox from Windows prompt

I want to start the latest Equinox framework but I'm stuck. I downloaded the latest version and tried to execute the command into windows prompt:
C:\equinox\plugins>java -jar org.eclipse.osgi_3.10.100.v20150529-1857.jar -console
But nothing happens. Do you know how I can start the framework?
EDIT
I downloaded launchers-win32.win32.x86_64.Mars.zip
C:\equin\eclipse\plugins>java -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Dosgi.console.enable.builtin=true -jar org.eclipse.equinox.la
uncher_1.3.100.v20150511-1540.jar -console
An error has occurred. See the log file
c:\equin\eclipse\configuration\1435578389939.log
C:\equin\eclipse\plugins>
In error log I get this:
!SESSION Mon Jun 29 14:44:18 IDT 2015 ------------------------------------------
!ENTRY org.eclipse.equinox.launcher 4 0 2015-06-29 14:44:18.529
!MESSAGE Exception launching the Eclipse Platform:
!STACK
java.lang.RuntimeException: Could not find framework
at org.eclipse.equinox.launcher.Main.getBootPath(Main.java:1025)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:588)
at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
at org.eclipse.equinox.launcher.Main.main(Main.java:1488)
Looks like starting standalone Equinox is very tricky.
It seems that sadly the build-in console is removed in equinox 3.10 so the osgi.console.enable.builtin=true system property will not work. It was useful when someone wanted to start equinox with a console rapidly, without adding any more bundles.
To use the gogo shell, there are many tutorials. In short:
Download the following artifacts (they are in the zip of Equinox Mars):
org.eclipse.equinox.console_1.1.100.v20141023-1406.jar
org.apache.felix.gogo.runtime_0.10.0.v201209301036.jar
org.apache.felix.gogo.shell_0.10.0.v201212101605.jar
org.apache.felix.gogo.command_0.10.0.v201209301215.jar
Run the command:
java -Declipse.ignoreApp=true -Dosgi.bundles=reference:file:org.eclipse.equinox.console_1.1.100.v20141023-1406.jar#start,reference:file:org.apache.felix.gogo.runtime_0.10.0.v201209301036.jar#start,org.apache.felix.gogo.shell_0.10.0.v201212101605.jar#start,org.apache.felix.gogo.command_0.10.0.v201209301215.jar#start -jar org.eclipse.osgi_3.10.100.v20150529-1857.jar -console -consoleLog
Alternatively, you can specify osgi.bundles in the config.ini file of equinox if there is one.
You can put the necessary jars into a subfolder. In that case, you must use the relative path after reference:file:. E.g.: reference:file:lib/myjar.jar.
Edit
I uploaded two samples (one with config.ini and one without) to here: https://drive.google.com/file/d/0B1GigvByKQkIbFRqbjFvbmNYdk0/view?usp=sharing
There are pre-configured Equinox OSGi Starter Kits available from eclipse itself. They are somehow tricky to find. Open the Equinox Project Download page and click on the blue triangle for OSGi starter kits.
Then you can download them for your platform. They have native executables but also valid configuration for "java -jar ..." executions.

Resources