Latest Entries »

In MacOSX  Java is installed by default to /System/Library/Frameworks/JavaVM.framework/Versions . Dont change anything in that folder

Java7 and java8 will be installed in to the folder

Java 7  :  /Library/Java/JavaVirtualMachines/jdk1.7_xxxx/Contents/Home

java 8  : /Library/Java/JavaVirtualMachines/jdk1.x.0_xx.jdk/Contents/Home/bin/javac

Step by step :

If /usr/libexec/java_home -v 1.8.0_92 –exec javac -version returns the correct verrsion, then your problem is with:

my example :

/System/Library/Frameworks/JavaVM.framework/Versions$ /usr/libexec/java_home -v 1.8.0_05 –exec javac -version

Unable to find any JVMs matching version “1.8.0_05”.

javac 1.7.0_75

second try:

System related java dont remove ever because this  Java is came from Apple MAC OS .

With a privileged user execute:

cd /System/Library/Frameworks/JavaVM.framework/Versions/
rm CurrentJDK  ( if this folder is not existed dont be exicite  run the following command
ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/ CurrentJDK

Solution found in Mankeh Blog


Also check this answer on Super User for dynamically switching JDK versions.

Update: I guess I’ve found the culprit! ( Source :

Try this:

rm -rf ~/Library/Java/Extensions
sudo rm -rf /Library/Java/Extensions

if you are going to remove the tools.jar  please keep the backup and remove it . when ever if it required copy the latest tools.jar from JDK 1.8 path

in general java7  tools.jar is located in /Library/Java/Extensions/tools.jar --> this is going to be use it as default . 

in Java8 :  /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/lib /tools.jar  

how to set java bash profile  if you have more than one jdk in your mac OSX


set your java bash profile

vi .bash_profile

#export JAVA_5_HOME=$(/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0_30/Home/bin/java)

#export JAVA_6_HOME=$(/usr/libexec/java_home -v1.6)

#export JAVA_7_HOME=$(/usr/libexec/java_home -v1.7)

#export JAVA_8_HOME=$(/usr/libexec/java_home -v1.8)

#alias java6=’export JAVA_HOME=$JAVA_6_HOME’

#alias java7=’export JAVA_HOME=$JAVA_7_HOME’

#alias java8=’export JAVA_HOME=$JAVA_8_HOME’


export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home






export PATH=${JAVA_HOME}/bin:$M2_PATH/bin:$M2_HOME/bin:$MONGO_HOME/bin:$ANT_HOME/bin:$GRADLE_HOME/bin:${PATH}

export MAVEN_OPTS=”-Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m”

# jana

set -o vi

[[ -s “$HOME/.rvm/scripts/rvm” ]] && source “$HOME/.rvm/scripts/rvm” # Load RVM into a shell session *as a function*

#export PS1=”\h:\W \u\ \d\ \t$”

#alias ls=’ls -1G’

export PS1=”\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ “

export CLICOLOR=1

export LSCOLORS=ExFxBxDxCxegedabagacad

# Setting PATH for Python 2.7

# The orginal version is saved in .bash_profile.pysave


#export PATH

eval “$(chef shell-init bash)”


I was able to unistall jdk 8 in mavericks successfully doing the following steps:

sudo rm -rf /Library/Java/JavaVirtualMachines/jdk.jdk
sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -rf /Library/LaunchAgents/
sudo rm -rf /Library/PrivilegedHelperTools/
sudo rm -rf /Library/LaunchDaemons/
sudo rm -rf /Library/Preferences/

Source :

Source : Mac OS X and multiple Java versions

install an additional java on MacOS? I installed jdk8 and that works fine. but now I need a jdk7 installation for development purposes. When trying to install the old version via DMG file, i get a warning, that there is already a newer version of java installed and the installer quits.



The cleanest way to manage multiple java versions on Mac is to use Homebrew.

And within Homebrew, use:

  • homebrew-cask to install the versions of java

    command :  brew update && brew cask install java

  • jenv to manage the installed versions of java

As seen on , these are the steps to follow.

  1. install homebrew
  2. install homebrew jenv
  3. install homebrew-cask
  4. install a specific java version using cask (see “homebrew-cask versions” paragraph below)
  5. add this version for jenv to manage it
  6. check the version is correctly managed by jenv
  7. repeat steps 4 to 6 for each version of java you need

homebrew-cask versions

Add the “caskroom/versions” tap to homebrew using:

brew tap caskroom/versions

Then you can look at all the versions available:

brew cask search java

Then you can install the version(s) you like:

brew cask install java7
brew cask install java6

And add them to be managed by jenv as usual.

jenv add <javaVersionPathHere>

I think this is the cleanest & simplest way to go about it.

Another important thing to note, as mentioned in Mac OS X 10.6.7 Java Path Current JDK confusing :

For different types of JDKs or installations, you will have different paths

On Mac OS X Mavericks, I found as following:

1) Built-in JRE default: /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home

2) JDKs downloaded from Apple: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/

3) JDKs downloaded from Oracle: /Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home




source :


“mvn dependency::tree

the above command will show the dependents of the pom.xml of submodules.
[INFO] Scanning for projects…
[WARNING] Some problems were encountered while building the effective model for com.bhn.printer:jana-printer-transformers-common:jar:1.0-SNAPSHOT
[WARNING] ‘dependencies.dependency.(groupId:artifactId:type:classifier)’ must be unique: com.fasterxml.jackson.dataformat:jackson-dataformat-xml:jar -> version ${jackson-version} vs 2.5.3 @ line 55, column 21

[WARNING] Some problems were encountered while building the effective model for com.bhn.printer:Jana-printer-transformers-service:jar:1.0-SNAPSHOT
[WARNING] ‘build.plugins.plugin.version’ for org.apache.maven.plugins:maven-surefire-plugin is missing. @ line 132, column 12
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects

solution :
first issue :



second issue :



source :

question :

How to promote a specific build number from another job in Jenkins?


I installed the Promoted Build Plugin from Jenkins and now I’m facing some troubles to promote a build from an existing job. Here is the scenario:

  1. There is an existing Nightly Buildjob that runs every night running all the tests and metrics needed;
  2. There is an existing Deploy Buildthat accepts a parameter ${BUILD_NUMBER} and deploys the build that has the corresponding ${BUILD_NUMBER} from the Nightly Build
    • Say the [Nightly Build] ran and successfully built the artifact #39
    • Now I can just run the [Deploy Build] passing in #39 as a parameter
      • The artifacts from [Nightly Build] #39 are going to be deployed

So far so good. Now is the part where I want to add the Build Promotions…

Is there a way to promote the Nightly Build #39 (notice that it was already built before) from the Deploy Build? Or maybe even from somewhere else, quite frankly I`m kind of lost here 😦

I don`t see them with a clear Upstream/Downstream relationship, because they don’t have a:always runs this build and then the other during the execution – the [Deploy Build] is executed sometimes only and not always after the [Nightly Build].

Update as of version 2.23 of Parameterized Trigger Plugin:

With version 2.23+ behavior changed (thanks AbhijeetKamble for pointing out). Any parameter that is being passed by Predefined Parameters section of calling (build) job has to exist in the called (deploy) job. Furthermore, the restrictions of called job’s parameters apply, so if the called job’s parameter is a choice, it has to have all possible values (from promotions) pre-populated. Or just use Text parameter type.


Yes, I have the exact same setup: a build job (based on SVN commits) and manually executeddeploy job. When the user selects any build from the build job (including older builds), they can then go to Promotion Status link and execute various deploy promotions, for example Deploy to DEV, Deploy to QA, etc

Here is how to setup the promotion on build job:

  • You will need these plugins: Parameterized Trigger Plugin, Promoted Builds Plugin
  • Check mark Promote builds when
  • Define Name “Deploy to DEV”
  • Under Criteria check mark Only when manually approved
  • Under Actions use Trigger/call builds on other projects
  • In Projects to build enter the name to your deploy job here
  • Check mark Block until the triggered projects finish their builds
  • Mark this build as failure if the triggered build is worse or equal to: FAILURE (adjust according to statuses of your deploy job)
  • Predefined parameters (Code A)

Code A:


Above, in the Predefined parameters section, the name to the left of = are the parameters that are defined in your deploy job. And to the right of = are the values that will be assigned to those parameters when this promotion executes. Defines three parameters Server, Job and BuildSelection.

The parameter Server= is my own, as my deploy job can deploy to multiple servers. However if your deploy job is hardcoded to always deploy to a specific location, you won’t need that.

The Job= parameter is required, but the name of the param depends on what you’ve setup in your deploy job (I will explain configuration there). The value $PROMOTED_JOB_NAME has to remain as is. This is an environment variable that the promotion process is aware of and refers back to the name of your build job (the one where promotion process is configured)

The BuildSelection= parameter is required. This whole line has to remain as is. The value passed is $PROMOTED_NUMBER, which once again the promotion is aware of. In your example, it would be #39.

The Block until the triggered projects finish their builds check mark will make the promotion process wait until the deploy job finished. If not, the promotion process will trigger the deployment job and quit with success. Waiting for the deploy job to finish has the benefit that if the deploy job fails, the promotion star will be marked with failure too.

(One little note here: the promotion star will appear successful while the deploy job is running. If there is a deploy failure, it will only change to failure after the deploy job finished. Logical… but can be a bit confusing if you look at the promotion star before the deployment completed)

Here is how to setup deploy job

  • You will need Copy Artifacts plugin
  • Under This build is parameterized
  • Configure a Choice (or Text) parameter with name Server (this name has to match with configuration in promotion’s Predefined Parameters in previous section)
  • Choices: Enter list of possible server IPs that would be used by the promotion’s Predefined Parameters in previous section (see update note below)
  • Configure a Choice (or Text) parameter with name Job (this name has to match with configuration in promotion’s Predefined Parameters in previous section)
  • Choices: Enter the name of your build job as default. This is only needed if you trigger thedeploy job manually. When the deploy job is triggered from promotion, the promotion will supply the value (the Job= from Predefined parameters that we configured). Also, if there is no value passed from promotion’s Predefined parameters, the first choice value will be used. If you have a 1-to-1 relationship between the build and deploy jobs, you can omit the Job= parameter in promotion’s configuration.
  • Update: since version 2.23 of Parameterized Trigger, the available choices in the deploy job configuration have to have all possible values coming from the promotion’s predefined parameters. If you don’t want that limit, use “Text” instead of “Choice”
  • Configure a Build selector for Copy Artifact with name: BuildSelection
  • Default Selector: Latest successful build
  • Under Build steps
  • Configure Copy artifacts from another project
  • In Project name enter ${Job}
  • At Which build choose Specified by a build parameter
  • In Parameter Name enter BuildSelection (without ${...}!)
  • Configure the rest accordingly for your artifacts that will be copied from build job to deployjob’s workspace
  • Use the copied artifacts inside the deploy job as you need in order to deploy

So now, with the above deploy job, you can run it manually and select which build number frombuild job you want to deploy (last build, last successful, by build number, etc). You probably already have it configured very similarly. The promotion on the build job will basically execute the same thing, and supply the build number, based on what promotion was executed.

Let me know if you got any issues with the instructions.

important Tutorials

Ruby Tutorials:

Why’s Poignant Guide:

Ruby on Rails Tutorial:

Ruby on Rails Guides:

Programming Ruby:

Sample Ruby Code:

Maven Tutorials: 

Apache Maven Guide:

Creating a Java Project with Maven:

XPath Tutorial:

YAML Tutorial:

*YAML Validator:

Selenium Documentation:

HTML and JS Tutorials:

Javascript documentation:

Ext JS Documentation:!/api

Regular Expressions Tutorial:

*Regular Expressions Validator:

How do I resolve git saying “Commit your changes or stash them before you can merge”?

I made some updates on my local machine, pushed them to a remote repository, and now I’m trying to pull the changes to the server and I get the message;

error: Your local changes to the following files would be overwritten by merge:
Please, commit your changes or stash them before you can merge.
So I ran git checkout — wp-content/w3tc-config/master.php and tried again and I get the same message. I’m assuming that w3tc changed something in the config file on the server. I don’t care whether the local copy or remote copy goes on the server (I suppose the remote one is best), I just want to be able to merge the rest of my changes (plugin updates).

Solution :

You can’t merge with local modifications. Git protects you from losing important changes. You have three options.
One is to commit the change using
git commit -m “My message”

The second is to stash it. stashing acts as a stack, where you can push changes, and you pop them in reverse order.

To stash type:

git stash
Do the merge, and than pull the stash:
git stash pop

The third options is to discard the local changes using git reset –hard.

Log :
jredd00$ git pull
Updating d35bba4..2fde888
error: Your local changes to the following files would be overwritten by merge:
Please, commit your changes or stash them before you can merge.
jredd00$ git stash
Saved working directory and index state WIP on master: d35bba4 Updated
HEAD is now at d35bba4 Updated
jredd00$ git pull
Updating d35bba4..2fde888
.gitignore | 2 +
/src/main/environments/common/ | 326 +++++++++++++++++++++++++++———————————————————-
config/src/main/environments/common/logback.xml | 2 +-

jredd00$ git stash pop
Auto-merging .gitignore
CONFLICT (add/add): Merge conflict in .gitignore

lmbhn3151:event-services jredd00$ vi .gitignore

delete the the line which ever you dont want ..

git add filename.txt

git commit -m ” test after merge ”

git push

git blame command


c:\tools\git\testscm\src\main\java\example>git blame –line-porcelain -w
WARNING: terminal is not fully functional
da46da35731e83df1e5f56e595cb4cb729089f33 1 1 18
author David RACODON
author-time 1413882279
author-tz +0200
committer David RACODON
committer-time 1413882279
committer-tz +0200
summary test
filename src/main/java/example/
package example;
da46da35731e83df1e5f56e595cb4cb729089f33 2 2

da46da35731e83df1e5f56e595cb4cb729089f33 3 3
public class One {

for MacOS Java Home setup and to know what java and Maven versions were installed in MacOS

commands : –
vi ~/.bash_profile

this is having the path likeis as follows :


export PATH=${PATH}:${JAVA_HOME}/bin:$M2_PATH/bin:$M2_HOME/bin

[[ -s “$HOME/.rvm/scripts/rvm” ]] && source “$HOME/.rvm/scripts/rvm” # Load RVM into a shell session *as a function*

Once you modified the any changes in ~/.bash_profile you need to restart bash_profile with the following command

Source ~/.bash_profile

generally in MacOS Jdk will be in the following path :
To know the which jdk version is installed in MacOS use the following command
For Java 1.8
jredd00$ /usr/libexec/java_home -v1.8
Unable to find any JVMs matching version “1.8”.


jredd00$ /usr/libexec/java_home -v1.6

jredd00$ /usr/libexec/java_home -v1.5
Unable to find any JVMs matching version “1.5”.

To change your Java verison instant command line ,
export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin

If you want to update JAVA_HOME with Jdk1.6 use the following pattern

jredd00$ export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

jredd00$ java -version
java version “1.6.0_65”
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

jredd00$ /usr/libexec/java_home -v1.6

In case if you have Java 1.7 in that situation also you can use


jredd00$ export JAVA_HOME=’/usr/libexec/java_home -v1.6′

jredd00$ $JAVA_HOME



jredd00$ export JAVA_HOME=’/usr/libexec/java_home -v1.7′

jredd00$ $JAVA_HOME



Note : this is only for temporary changes how to switch back and forth for java 1.6 and Java 1.7  . once you close the terminal it will be end .. not for permanant change .


source :

Pre-Installation Check list: 
1) Install Windows Server 2008 R2 64 bit version or any other 64 bit Operating System
  •   Configure the static IP address
  •   Activate Auto Updates
  •   Add role – Active Directory Services
  •   Add role – Active Directory Lightweight Services
  •   Add feature – Windows Process Activation Service
  •   Add role – Web Server (IIS) (*Refer note below)
  •   Add feature – PowerShell
2) Enable TCP Port Sharing
3) Installing Exchange Server 2010
4) To setup Authenticated Access
5) Adding Email User
Number Port Protocol Description Quick List
1 20 FTP Data File Transfer Protocol – File Transfer Protocol. Port for data.
2 21 FTP Control File Transfer Protocol – File Transfer Protocol. Port for commands.
3 22 SSH Secure SHell – “secure shell”. Remote Management Protocol operating system.
4 23 telnet TErminaL NETwork. Protocol implementation text interface over the network.
5 25 SMTP Simple Mail Transfer Protocol – Simple Mail Transfer Protocol.
6 42 WINS Windows Internet Name Service. Mapping NetBIOS-name computers with IP-addresses of nodes
7 43 WHOIS “Who is”. Protocol obtaining the registration of ownership of domain names and IP addresses
8 53 DNS Domain Name System – Domain Name System.
9 67 DHCP Dynamic Host Configuration Protocol – Dynamic Host Configuration Protocol. Dynamic IP
10 69 TFTP Trivial File Transfer Protocol – a simple file transfer protocol.
11 80 HTTP / Web HyperText Transfer Protocol – hypertext transfer protocol.
12 110 POP3 Post Office Protocol Version 3 – receive e-mail protocol, version 3
13 115 SFTP SSH File Transfer Protocol. Secure data transmission protocol.
14 123 NTP Network Time Protocol. Synchronization protocol computer’s internal clock.
15 137 NetBIOS Network Basic Input / Output System. Protocol for network I / O operations. Naming Service.
16 138 NetBIOS Network Basic Input / Output System. Protocol for network I / O operations. Service connection.
17 139 NetBIOS Network Basic Input / Output System. Protocol for network I / O operations. Service sessions.
18 143 IMAP Internet Message Access Protocol. Application-level protocol for accessing e-mail.
19 161 SNMP Simple Network Management Protocol – Simple Network Management Protocol. Device Management.
20 179 BGP Border Gateway Protocol, Border Gateway Protocol. Dynamic routing protocol.
21 443 HTTPS HyperText Transfer Protocol Secure) – protocol HTTP, which supports encryption.
22 445 SMB Server Message Block. The remote access to files, printers, and network resources.
23 514 Syslog System Log. Protocol and sending log messages about system events occur.
24 515 LPD Line Printer Daemon. Remote printing protocol on the printer.
25 993 IMAP SSL Protocol IMAP, supports SSL encryption.
26 995 POP3 SSL POP3 protocol supports SSL encryption.
27 1080 SOCKS SOCKet Secure. Receiving protocol secure anonymous access.
28 1433 MSSQL Microsoft SQL Server – database management system. Port to access the database.
29 3128 Proxy Currently the port often used proxies.
30 3268 LDAP Lightweight Directory Access Protocol – lightweight directory access protocol (directory service).
31 3306 MySQL Access to MySQL databases.
32 3389 RDP Remote Desktop Protocol – Remote Desktop for Windows.
33 5432 PostgreSQL Access to PostgreSQL databases.
34 5900 VNC Virtual Network Computing – a system of remote access to the desktop computer.
35 5938 TeamViewer TeamViewer – Remote control system for ensuring your computer and data exchange.
36 8080 HTTP / Web Alternate port for the HTTP protocol. Sometimes used proxies.

To use another JDK see here:

which states:

” To run a different version of Java, either specify the full path, or use the java_home tool:

/usr/libexec/java_home -v 1.7.0_06 --exec javac -version

Here is an illustration and examples from my setup:

Oracle JDK installs:

odin:~ geff$ ll /Library/Java/JavaVirtualMachines

total 0
21058660 0 drwxr-xr-x  3 root  wheel  - 102 24 Oct 18:04:33 2012 jdk1.7.0_09.jdk/
21061692 0 drwxr-xr-x  3 root  wheel  - 102 24 Oct 18:06:08 2012 jdk1.7.0_07.jdk/
21042328 0 drwxrwxr-x  3 root  wheel  - 102 20 Apr 06:58:53 2012 1.7.0.jdk/
21031664 0 drwxrwxr-x  7 root  admin  - 238 24 Oct 18:04:16 2012 ../
21042327 0 drwxr-xr-x  5 root  wheel  - 170 24 Oct 18:06:13 2012 ./

Apple supplied JDK:

odin:~ geff$ ll /System/Library/Java/JavaVirtualMachines 
total 0
21026468 0 drwxr-xr-x  3 root  wheel  - 102  1 Nov 17:49:02 2011 1.6.0.jdk/
21026436 0 drwxr-xr-x  6 root  wheel  - 204 24 Mar 23:04:06 2012 ../
21026467 0 drwxr-xr-x  3 root  wheel  - 102  1 Nov 17:49:02 2011 ./

This works for me also to use the Apple supplied 1.6 JDK

odin:~ geff$ /usr/libexec/java_home -v 1.6.0_37 --exec java -version
java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06-434-11M3909)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01-434, mixed mode)

Choose between the 1.7 Oracle versions:

Selecting the first Oracle JDK 1.7.0_04

odin:~ geff$ /usr/libexec/java_home -v 1.7.0_04 --exec java -version
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b21)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)

Selecting JDK 1.7.0_07

odin:~ geff$ /usr/libexec/java_home -v 1.7.0_07 --exec java -version
java version "1.7.0_07"
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

The default JDK is the highest one:

odin:~ geff$ java -version
java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)

Defaults to the highest “patch level when using only minor version number:

odin:~ geff$ /usr/libexec/java_home -v 1.7.0 --exec java -version
java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)

regards Geff