Categories
Java

Error: Could not create the Java Virtual Machine [Vaadin]

Vaadin built and received an error as error log: [INFO] Using com.vaadin:vaadin-client-compiler version 7.2.7 [INFO] Error occurred during initialization of VM [INFO] Could not reserve enough space for object heap [ERROR] Error: Could not create the Java Virtual Machine. [ERROR] Error: A fatal exception has occurred. Program will exit. [ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:7.2.7:update-widgetset…

Categories
Java

When do we use maven-compiler-plugin ?

Overview The Compiler Plugin is used to compile the sources of your project. Setup Place following the maven pom structure, please add following lines to plugins block: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.0</version> <configuration> <source>1.6</source> <target>1.6</target> <encoding>UTF-8</encoding> </configuration> </plugin> The version, you need to define according to the maven2 version you installed. All versions, you can find…

Categories
Java

How to find maven repository?

Where can we search for right maven repository?

Categories
Java

Sample layout pom.xml for Java project

To make you get into Maven 2 project easily, let’s have a look to pom.xml general layout for Java project, here it is: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.osify.training</groupId> <artifactId>sample-java-training</artifactId> <packaging>jar</packaging> <name>Osify Training Sample</name> <description>Osify Training Sample</description> <version>1.0.0-SNAPSHOT</version> <parent/> <prerequisites /> <repositories/> <scm/> <properties/> <dependencies> <dependency/> </dependencies> <build> <sourceDirectory>src/main/java</sourceDirectory> <outputDirectory>target/classes</outputDirectory>…

Categories
Java Tools

Add log4j to your Java project

Log4j is a logging mechanism that is in Apache foundation project. Log4j is for Java project. Here, to add logging feature to your Java project, you can use one as following ways: Manually Visit http://logging.apache.org/log4j/ Download the Log4j jar library Manually include it into your project dependency All manage by yourself, you need to do…

Categories
Java

Struts 2 Maven Dependencies

What are the required dependencies to develop struts 2 application with Maven 2?

Categories
Tools

Install Maven 2 build tool on Windows

If you just start to develop some application, you need some built tools to help to package, compile or make your development structure look right. Maven is a right tool for that. It’s simple and easy to use, it works with many of programming languages, especially with Java. Here is simple steps to install maven…

Categories
Java

Generate jar and manifest Info in Jar in maven 2

To create jar packaging of Java project with maven 2 based, we used a plugin called: maven-jar with simply paste the code below in pom.xml of plugins section: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.4</version> <configuration> <archive> <manifest> <addClasspath>true</addClasspath> </manifest> </archive> </configuration> </plugin> And if you want to add in your jar’s MANIFEST info, you can directly modify…

Categories
Java

Generate source code Jar for Maven 2 based project

Some case, you need to generate source code from your project which is maven 2 based. Please have a look to maven-source plugin by adding a short code below into your pom.xml <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <executions> <execution> <id>attach-sources</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> By default it will generate jar named as: ${project.artifactId}-${project.version}-source.jar