I downloaded the 2.5.0 source, and built it by cd'ing to the hornetq-master directory and running mvn clean install (I've also tried mvn clean package). The build reported a success.
According to the 2.4.0 manual, which is the newest I found,
"In the distribution you will find a directory called bin.
cd into that directory and you will find a Unix/Linux script called
run.sh and a windows batch file called run.bat"
If I go to hornetq-master/distribution/hornetq/src/main/resources/bin, I see those files. I don't see any kind of target directory, which I would have expected after a build.
If I execute run.bat, I get an error "Could not find or load main class org.hornetq.cli.HornetQ".
If I look at the hornetq.cmd file, it appears to be trying to use a classpath of %HORNETQ_HOME%\lib, which in my case would be hornetq-master/distribution/hornetq/src/main/resources/lib, which doesn't exist.
So, I assume I'm building this incorrectly. Can somebody tell me how it should be built?
Looks like "distribution" in the manual here is referring to the official distributed .zip file, not something built from source.
Related
I'm having big problems running my java api war file from the command line after ive packaged it with maven.
I'm trying to run it using the following command from the target folder where my war file is located.
java -cp silverkissen.war se/consys/silverkissen/heroku/Main
And alot of other variations but i just get
Error: Can't find or load main class se/consys/silverkissen/heroku/Main
My war file lies in path ..\Silverkissen-API\target\silverkissen.war
My heroku main class lies in path ..\Silverkissen-API\target\classes\se\consys\silverkissen\heroku\Main.class
Thankful for any help.
The main issue is most likely because the class files isn't incorporated into the silverkissen.war file. Meaning there is no Main function in the war file itself. Or that the entry function is some where else.
Or that it's packaged in some mysterious way that is beyond my understanding that's specific to maven, heroku etc.
But assuming you're standing in the project root structure, one level before the target folder usually where you'd normally have src, target, pom.xml and system.properties. I'd try running the following:
java -cp target/classes:target/dependency/* se.consys.silverkissen.heroku.Main
And if you're on Windows that'd be:
java -cp target\classes;target\dependency\* se.consys.silverkissen.heroku.Main
That aught to do it. This will execute your project with class-path's in the runtime. Assuming my limited knowledge of Java is correct.
Someone with more experience can probably explain in detail why this would work.
Open command prompt in the location where your jar/war located
And then run below command
java -jar silverkissen.war
I am trying to learn how to build applications using Gradle; to do this I use the 'Application' plug in. This plug in builds executable scripts that runs my jar file. However the batch file that is generated is showing an error. This is for every project I build with Gradle.
I can execute the jar file fine using 'java -jar app.jar' but the app.bat file only shows the error.
The error shows is;
Error: Could not find or load main class com.test.Main
I have exhausted my ability to search stackoverflow and google for a solution. It seems possible that there is an error with the %CLASSPATH%?
Note: I had the batch file for an early project working perfectly fine. When revisiting the project later in the day (no code changed) the batch file fails to run. This makes me thing there is a setting/ environment issue more than a programmatic one?
I needed to use the assembleDist task to create a zip folder. This zip folder contained the sh and batch files with the correct classpaths and worked perfectly.
Note: The sh and batch files located in /scripts are used by Gradle to run the application during development. When trying to execute them from the terminal or command prompt they could not find the main class or the libraries used. As far as I can tell this was due to the %CLASSPATH% not being tailored for use outside of gradle.
Running the distribution task creates an archive of the project containing all of the required files and working execution scripts. These were the files I should have been testing, not those found in the gradle project.
I know that there are a lot of questions for this topic out there, although I have tried a lot of things, I cannot figure out where the problem is.
Specifically I try to execute the jar file of webgraph using
java-cp webgraph-3.5.2.jar it.unimi.dsi.webgraph.ASCIIGraph
I looked in the jar-file and the class file is present in the it/unimi/dsi/webgraph folder, which seems to be OK. When running the command I still get
Error: Could not find or load main class it.unimi.dsi.webgraph.ASCIIGraph
I tried to specify all the libs separated by a semi-colon, which didn't help (I would also expect another error message for missing libs)
I run through the same problem and I finally figured it out after so many researches. Here is the way to pass that error.
step one: Download and extract Apache Maven binaries from Here
step two: Download the dependencies tarball from here and extract it
step three: Retrieve the WebGraph framework source code with extensions from this repository. The version contains the copy list and copy flags compression formats, as well as additional flags for the other compression schemes.
step four: Compile the JAR file of the framework using Maven by running "mvn install" within the WebGraph root directory.
step five: Copy the target/webgraph-3.5.2.jar file in to the same location as the JAR files from the dependencies [the tarball dependencies].
here is the trick now, you need to specify exactly where the tarball dependencies are in order to get your expected result. Hence, assuming my tarball dependencies are in my '~/webgraph-deps/' directory,
$ java -cp "~/webgraph-deps/*" it.unimi.dsi.webgraph.ASCIIGraph <WHATEVER_YOU_WANT_TO_DO>
Plus, if the above command fails, it might be because of running out of memory and use the following command [it will set initial heap size for Java to work on, I have 12GB of RAM and allocated 6GB for this process (-Xmx6G)]
$ java -Xmx6G -cp "~/webgraph-deps/*" it.unimi.dsi.webgraph.ASCIIGraph
Here is my reference, https://github.com/lhelwerd/WebGraph. check it out for more!!
Ultimately, I want the following to work
(ns grizzler.core
(:import (com.sun.grizzly.http.embed GrizzlyWebServer)
(com.sun.grizzly.tcp.http11 GrizzlyAdapter)))
However, I have no idea how to go about this. Do I add stuff to my classpath? Where do I modify my classpath, in my .bashrc or within clojure?
I've found the grizzly project at http://grizzly.java.net/. But what do I download? How do I install things? I really just have no idea what to do.
Related: Using 3rd party java libraries, like com.jcraft.jsch, with clojure - except that it's not detailed enough for me :(
Edit: I also tried the following in project.clj and it didn't work:
(defproject grizzler "1.0.0-SNAPSHOT"
:description "FIXME: write description"
:dependencies [[org.clojure/clojure "1.3.0"]
[com.sun.grizzly.http.core "2.1.10"]
[com.sun.grizzly.http.embed "2.1.10"]
[com.sun.grizzly.tcp.http11 "2.1.10"]])
In addition, I tried net.java.grizzly.http.core , and that didn't work either.
Thanks!
The current consensus on the "right" way to do this is basically "use leiningen". Leiningen is basically a wrapper around maven and uses maven repositories. Most of the time you can find the code you need in a maven repository somewhere, though eventually you will be in this situation where you need to use a jar file. In this case you install the jar file into your local maven repository which lives in your home directory and contains copies of all the jars required to build all your projects. In cases where the jars you depend on are available from a central repo this local repo acts as a cache so you don't have to download them every time, though you can manually put jars into your local repo if it can't automatically download them.
I recommend watching this video first.
check carefully to see if the library you need is already available
download the jar you want
download leiningen
run lein new nameOfYourProject
add it to your leiningen project's project.clj
run lein deps
this will print the full command for installing the jar file to your local maven repo
run this command (as printed by leiningen) and your jar file should be copied to the correct location under ~/.m2/...
run lein deps again to make sure it finds it
add an import statement in your .clj file (as you have above)
success!
Debugging this process can be very situation specific, but the denizens of #clojure are usually quite helpful.
I tried to figure out how I can build a final version of fullcalendar.js from github. On github, the src files is compound of multifiles and the final version is unique...
The indication on github is the following but I didn't catch what I have to do
You must have a Java runtime environment (accessible by the java
command) for minification. Then, run make zip and check the dist/
directory for your newly created ZIP archive. To start fresh, run the
make clean command.
The github page is https://github.com/arshaw/fullcalendar. If anyone has an idea where to find a tutorial to explain how to minify for dummies I would be pleased....
I try to use the console Windows. Then to write java. Return, then write make zip Return and then I get a error message...
From the Github page it looks like the Makefile handles the minification for you. Just make sure you have a JRE installed and from the command line navigate to the repository directory and run make zip, and your zip should be in the dist/ folder.
I had to use my vmplayer running centos 6 to run this command. Appearantly we are expected to know that we have to be on linux to do the compile. I too tried to do this on Windows 7 at first but ended up on linux.