Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

New FAQ from a Newbie to Java!

 
Eddie Gerlach
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, everyone...

I'm brand new to Java and programming in General.....I am running a MacBook Pro with Parallels 7 for Mac and have D/L Windows 7 to that....I then D/L the latest JDK1.7.0_09 along with JRE7 and NetBeans 7.2 to Parallels..purchased Dr. Y. Daniel Liang's book "Introduction to Java Programming, 9th Edition, Comprehensive, which also includes a MyProgrammingLab....so,

I am slowly understanding NetBeans, however, am trying to utilize the Command Prompt to compile and run my first "Welcome to Java" program per my homework assignments. When I attempt to compile javac I receive the error "is not recognized as an internal or external command, operable program or batch file." OMGosh! when trying java -version, I now see:

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)

C:\Users\Administrator>

My Environment Variables for path is "JAVA_HOME C:\Program Files\Java\jdk1.7.0_09\bin;
My System Variable for path is "OT%\System32\WindowsPowerShell\v1.0\

For what its worth, I can't seem to find the javac.exe in "C:\ Program Files\Java\jdk1.7.0_09 of jre7....is it possible that I installed the JDK/JRE to Parallels 7 instead of to the Mac? Installed by default to Program Files and not Program Files x86? Incorrect paths? Whew! Afraid I've bitten off a bit more than I can chew at this point....thanks for any and all support and replies!

Eddie Gerlach
Mt. Dora, Florida
 
William P O'Sullivan
Ranch Hand
Posts: 859
Chrome IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try: C:\Program Files\Java\jdk1.7.0_09\bin\javac -version

Something doesn't look right in your setup.

WP
 
Eddie Gerlach
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William,

Thanks for the prompt reply....do you mean modify my Environment Variable to reflect your suggestion, i.e remove the JAVA_HOME prefix and add the \javac -version as my suffix?

Eddie
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My Environment Variables for path is "JAVA_HOME C:\Program Files\Java\jdk1.7.0_09\bin;


That's wrong.

EITHER, have a JAVA_HOME variable, and then include

in your PATH,

OR just put the full path to bin directly in your path:


Also, you'll have to open up a new command prompt after modifying the path to be able to use the new stuff.

And note that this really has nothing to do with Java. The same rules apply for any executable you want to invoke without providing a full path.

 
Eddie Gerlach
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeff,

thank you for the assistance...I have found javac in the bin file from C:Program Files\Java\jdk1.7.0_09\bin.....should I delete the existing JAVA_HOME path in the Environment variable and add "C:Program Files\Java\jdk1.7.0_09\bin;" as a new path in the Environment variable? I can see the Welcome.java file in the Java Command Prompt directory, but still can't use the javac Command to compile it to Welcome.class......then I would run "java Welcome" to execute it to display "Welcome to Java!", correct?

Sorry, but I don't know or understand what information I would put to replace "some stuff" prior to C: and "other stuff" after the bin;...appreciate the patience!

Eddie
 
Eddie Gerlach
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
UPDATE!

I entered "C:Program Files\Java\jdk1.7.0_09\bin;" as my new Environment variable and when I entered "javac Welcome.java" in the new Command Prompt, I received my new C:\java>!

Now I should see the new "Welcome.class" reflected when I pull up the refreshed java directory (which it is!)...now, java Welcome and "Voila!"

Welcome to Java!

Hooray, beer!

Thanks to everyone again for your input and assistance!

Eddie
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eddie Gerlach wrote:
Sorry, but I don't know or understand what information I would put to replace "some stuff" prior to C: and "other stuff" after the bin;...appreciate the patience!


That's just a placeholder for whatever may have been in your PATH before. You don't want to completely replace your existing PATH. You just want to add Java to whatever is already there.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic