Sunday, March 9, 2014

How to add a single file to an existed GitHub repository

So today, after finishing the required editing about my forthcoming published tutorial on JCG, I wanted to push the final compressed project in the corresponding GitHub repository.

Here is a full guide of how he do something like this:
  • Firstly, locate Git Shell to the directory of the local repository
  • Ensure that you have the right "version" of the remote repository by pulling it: git pull
  • Add the file that you wish to push: git add [filename]
  • Commit changes (it is recommended to also submit a commit message, something that can be done with the -m parameter): git commit -m "your commit message"
  • Push changes to the remote repository: git push
And here's a full screenshot of my effort - yes, you did make it clear; I made a mistake (tried to push without having my repo pulled first) just to demonstrate how helpful is the error handling provided from the shell.
And a personal statement: Finally, I have to admit that learning Git wasn't a pain at all.




Friday, March 7, 2014

How to fix Java heap space error in Maven

So you want to build a maven project but you 're getting an error like this : java.lang.OutOfMemoryError: PermGen space.

What the output says is that you have to define a MAVEN_OPTS environment variable, where you can place your -Xmx and -XX:MaxPermSize memory parameters.

What are you staring at? Go for it!


  • Right click on My Computer and select Properties
  • Click Advanced System Settings on the left
  • Go to the Advanced tab, click the Environment Variables
  • Create a New user variable, under the name of to MAVEN_OPTS and set the Variable value to what the error specified or whatever you need to get it build successfully.


  • Here's a sample configuration :


    Thursday, March 6, 2014

    JSF projects available on GitHub

    I found myself today having a lot of desire to contribute to community, although I needed a lot of rest, so here is my latest commit to my github account : JSF 2.2 projects .


    I know, all of us would prefer the full sources of it, but keeping in mind my full schedule this period, it's the best I could do.

    How to export Eclipse project as a .zip file

    Hi there!

    After a pretty exhausting day at work, I thought why not updating a little bit my blog with a post that someone could find useful?

    I got inspiration while writing my last tutorial for Java Code Geeks, which I scheduled for tomorrow (and yes, you guessed it right, I'm gonna talk again about a tutorial of mine hah).

    So, most of you that ended up to this post, possibly found yourself in the same position as I did, a long time ago: while working on an eclipse project, you simply thought about zipping the whole project and yes, it would be cool if there was a way to implement it not by hand.

    Here are the steps:


    • Right-click on the project and navigate to Export :


    • Select Archive File and click Next : 


    • Select which folders/files you wish to exclude from the final .zip (I excluded the target folder, as you see), give a name to the compressed file and hit Finish : 


    And a final note : target  folder is what comes out from maven execution, so we obviously don't need it in a .zip file or in a project that we plan to upload to github, for example.

    Hope you found it interesting,
    Cheers!