Get a version ready to use from github - java

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.

Related

Generating a runnable .jar file from a libgdx project in intelJ

I basically just spent the whole day trying to get a runnable .jar file from my libgdx project working. In previous projects on a diffrent pc I used to simply navigate my way into the project root folder with cmd and used "gradlew desktop:dist" command. However right now I'm getting error message whenever I try this method.
error
How do I know which folder gradle searches my "tools.jar" file from? I tried even copying it to a few places with no success. I'm using windows OS.
For IDE, I'm using intelJ idea with newest version. I tried to use the "build artifacts" method from IntelJ but what ends up happening with the generated file is that it instantly closes/crashes whenever opened. When running the generated file throught command prompt I get a huge host of errors too numerous to name let alone fix. It seems like it doesen't include the required structures / project folders properly when using artifacts build.
Seems, your environment variable points to the installed JRE(Java Runtime Environment), but has to the Java Development Kit (JDK), because tools.jar is one of the files used by the development tools. You can take a look at the JDK and JRE File Structure to figure out, where is tools.jar located.
So, you have to install JDK(if it was not installed) and make the JAVA_HOME environment variable to points to it.

Using the HornetQ standalone server

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.

How to run Java project

A friend of mine once gave me a Java project on offline browser. It contains all class file as well as Java sources but I don't know how to run it or how can I check how it works . It doesn't contain any database or applet. please help
If you want to run a java .class file, open the terminal (if you are using Unix machine) or the command line (if you are using a Windows machine) and type java filename Note: filename does not include the .class extension, just use the name of the file and do not include the extension.
If you get an error this probably means you don't have java installed.
Import it into Eclipse or NetBeans and then click "run"...
That would be the simplest solution in my mind

Can't open a .jar file on my mac

I'm trying to download jsoup on my mac (Mountain Lion). I've downloaded the jsoup.jar file and installed the last java 7 from the site. But here is the problem, when I double click the .jar file it tells to me:
The Java JAR file “jsoup-1.7.2.jar” could not be launched. Check the
console.
I can't find even the console! Someone can help me? I read a lot of answers about this topic, but they all talk about Java 6 and it has different settings that can't find.
EDIT
i also tried from the terminal with this command:
java -jar /Users/Ben/Downloads/jsoup-1.7.2.jar
but it tells me:
Failed to load Main-Class manifest attribute from
/Users/Ben/Downloads/jsoup-1.7.2.jar
The JSoup JAR is not executable, so you are not going to be able to 'run' it in any of the ways you described. You are supposed to include it in your project classpath and use classes from it to do your parsing (after importing them of course).
You might want to refer to the JSoup Guide for examples on using the library.
I guess you are trying to run the jsoup library as a standalone application assuming it to be an executable jar. All indicates that the jar file you are using is NOT an executable jar hence it wont work.
jsoup.jar is supposed to be used as a java library and you will need to write java code to be able to use the HTML parsing capabilities.
If you are using an IDE like IntelliJ, you can open the module settings for a particular project and select Libraries. There'll be an option to add a particular external library from the Maven repository after which you can download the JAR and include it in your project's dependencies.

noClassdeffounderror with external jar when running code from a different location

I'm learning Java and was trying to test my code on another machine but am running to the above error. I've looked at youtube videos, read forums(and SO) but still can't get this to work.
I basically wrote some code on my mac using eclipse that referenced an external jar file. I have that jar in my lib folder and have added it to my build path in Eclipse via right-click "Build Path -> Add to Build Path". The code works fine on my laptop.
But when I try to run it from a linux command line, I get the above error. I am taking the code from eclipse and copying it to a file(first_try.java) and then run this commands:
CLASSPATH=./jedis-2.0.0.jar;export CLASSPATH
javac first_try.java
java -classpath . first_try
but then I get the error: Exception in thread "main" java.lang.NoClassDefFoundError: redis/clients/jedis/Jedis I downloaded the program via wget and checked permissions and tried different variations. There was a similar question I found(out of the many related ones) that had a similar context as mine but it worked for the user to just type java filename (which is not working for me)
I am learning a bit of java code but have never been successful at running external jars. I'm wondering what I'm doing wrong and what I can do to permanently fix it(ideally I want to write code locally and then copy it and test it on another machine like this)?
Or is there a better way to deploy code that depends on third party jars to other systems?
You are building your class path env var but then you don't use the value in your java command. You need $CLASSPATH instead of the dot after -classpath
Good luck learning java, I have enjoyed using it for over 10 years now ;)

Categories

Resources