Showing posts with label Troubleshooting. Show all posts
Showing posts with label Troubleshooting. Show all posts

Dec 15, 2013

How to fix an error "Unable to find a $JAVA_HOME at “/usr”, continuing with system-provided Java"

Somehow, I have got this error whenever I run Java command:

$java -version
Unable to find a $JAVA_HOME at "/usr", continuing with system-provided Java...
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

I found the same error as my case at the stackoverflow.

Unable to find a $JAVA_HOME at “/usr”, continuing with system-provided Java

This happens when $JAVA_HOME is not set correctly. In my case, the following works form me.

export JAVA_HOME="$(/usr/libexec/java_home)"

My environment is as follows:
  • OS X 10.9
  • Java 1.7.0_25 (installed by brew)

Aug 5, 2011

g++ compile error: declaration of "XXX" shadows a parameter

I found below error when I compiling C++ program with g++:
declaration of "XXX" shadows a parameter
Acording to the forum in cprogramming.com, which titile is "declaration of "blah" shadows a parameter??", you see this when you make derived class and don't initialize it with a constructor initialization list.

Jul 13, 2011

Android: “Path for project must have only one segment”

If you find this message when you are launching the Android application, the Eclipse cannot find the path to the project.
Path for project must have only one segment.
You have to specify the Project name for the Launch configuration.

Refference:
Stackoverflow.com, Android: “Path for project must have only one segment”

Jul 3, 2011

compile problem because of an expired debug certificate

When I was compiling my Android app, I couldn't do it. I found this message in Problem view.
Error generating final archive: Debug certificate expired on XXX
I found same problem in android web site. According to the site, the Android build tools local debug key but it is already expired. To fix this problem, I had to regenerate my debug key.

Here is the step.
  1. delete the debug keystore/key already generated by the Android build tools. Specifically, delete the debug.keystore file. On Linux/Mac OSX, the file is stored in~/.android. On Windows XP, the file is stored in C:\Documents and Settings\<user>\.android. On Windows Vista, the file is stored in C:\Users\<user>\.android
  2. generate new debug keysore file with this command: keytool -genkey -v -keystore <PATH_TO_FILE>/debug.keystore -alias androiddebugkey -keyalg RSA -validity 10000 -dname "CN=Android Debug,O=Android,C=US"
Note: <PATH_TO_FILE> is a path to the debug keystore file. Please set appropriate path for your environment.