0

Ok I am trying to make a project from a command line ( not really sure how my book doesn't say WHAT OR WHERE the command line is ) and when I try to run android.bat from the windows command prompt I get this error telling me that it checked for Java 64 bit and it wasn't found , then it checked for Java 32 and it wasn't found. The thing is I just installed Java SE 32 bit last night from Oracles site.

In Control Panel Programs I see :

Java (TM) SE Development Kit 6 Update 23 Oracle 141 MB 1.6.0.230

Why is Android telling me it's not found?

Windows 7 Ultimate 64 bit Q6600 Intell quad core 4GBs DDR2 Ram Nvidia 8800 GTS Asus D2X
Gigabyte EP45-DSL3R

UPDATE: Ok now I get this error :

Microsoft Windows [Version 6.1.7600] Copyright (c) 2009 Microsoft Corporation. All rights reserved.

G:\Programming\android-sdk_r08-windows\android-sdk-windows\tools>android create project --target 2 --path ./FirstApp --activity FirstApp --package Error: Missing argument for flag --package.

Usage: android [global options] create project [action options]

Global options: -v --verbose Verbose mode: errors, warnings and informational messages are pr inted. -h --help Help on a specific command. -s --silent Silent mode: only errors are printed out.

Action "create project": Creates a new Android project. Options: -n --name Project name -t --target Target ID of the new project [required] -p --path The new project's directory [required] -k --package Android package name for the application [required] -a --activity Name of the default Activity that is created [required]

G:\Programming\android-sdk_r08-windows\android-sdk-windows\tools>apt.tutorial

4
  • 1
    not really sure how my book doesn't say WHAT OR WHERE the command line is Then maybe you shouldn't try to build from the command line and just use eclipse? Commented Dec 8, 2010 at 23:53
  • 2
    Try defining JAVA_HOME to be where Java is installed, and make sure the Java commands (java, javac, etc.) are in your PATH. Those commands are usually in the bin directory inside of wherever Java is installed. Commented Dec 8, 2010 at 23:57
  • @Falmari Yes I have eclipse set up with the Android SDK and would prefer that method, but my Android 2 book is teachign how to make a project from the command line so I decided to try it out. Commented Dec 9, 2010 at 0:17
  • @Common Heres the line the book uses no mention of home any where: android create project --target 2 --path ./FirstApp --activity FirstApp --package apt.tutorial Commented Dec 9, 2010 at 0:19

1 Answer 1

1

Heres the line the book uses no mention of home any where: android create project --target 2 --path ./FirstApp --activity FirstApp --package apt.tutorial

That is one of my books.

Step #2 of Tutorial 1 has you check your Java environment and set up your PATH. This occurs before Step #4 of Tutorial 1, where you use android create project. AFAIK, that should have been sufficient. However, I do not use 64-bit Windows, and so I have no idea if there are any other things you need to do to get Java working there.

If you have further questions about this tutorial, please join the cw-android Google Group and ask there.

Please note that the version of the book you are using (Version 1.0 or the 1st Edition) is about 18 months old at the time of this writing, so you may encounter some challenges along the way. In particular, the latter half of the book is dominated by a sample Twitter client, which will no longer work due to the 2010 modification in Twitter authentication models. I have some instructions for how to try to patch the book, in essence, to use identi.ca, another microblogging client.

UPDATE

As you noted, I had the wrong book in mind. Here are the steps to set up your PATH, as described in Android Programming Tutorials:

You should also be sure to add the directory for the Java commands to your PATH by:

  1. Finding where the Java commands are (e.g., C:\Program Files\Java\jdk1.6.0_12\bin).

  2. Go to your Control Panel (Start > Settings > Control Panel).

  3. Double-click on the System applet.

  4. Click the Advanced tab.

  5. Click the Environment Variables button.

  6. If there is a PATH value in the User variables area at the top, add your path to the end by double-clicking the existing one, scrolling to the end, typing a semicolon (;) and the path from step #1 above. If there is no such PATH value, click the New button, fill in PATH as the Variable name and the path from step #1 above as the Variable value.

Sign up to request clarification or add additional context in comments.

13 Comments

Actually this version is Beginning Android 2 by Mark L Murphey , the book was made this year 2010
@jchase520: Oops. I had forgotten that I had used apt.tutorial there as well as in Android Programming Tutorials, where most of the apt.tutorial stuff resides. That book definitely assumes prior Java experience and a working Java environment. And my last name does not have an 'e' in it. :-)
:) Sorry my friend! Well I'm on Chapter 6 of my Java book from Head First, I also have prior experience with C++ , C , HTML , XHTML , CSS and Small / Pawn. So this isn't my first language but I'm reading both books at once lol
@jchase520: FWIW, I am rewriting all of the front matter of that book for its next edition under my own brand (The Busy Coder's Guide to Android Development), so this stuff should improve over time. I hope the book proves useful!
@jchase520: If you did not do so already, open a fresh Command Prompt, as local environment variable changes do not take immediate effect. Then, try running just java at the C: prompt. If that fails, then there is still something wrong with your PATH.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.