Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-01-2007, 05:47 PM
Member
 
Join Date: Jul 2007
Posts: 40
mathias is on a distinguished road
Help, starting with java
Hi, It asks me to download java sdk.
I download it, and i receive a folder in my c:/
When i try to compile "javac" it says "javac is an invalid command"...
I was wondering if someone could just teach me how to get past this bit maybe on messenger or here...
I would even allow a remote assistance so you can do demonstrations...
I really want to learn this language....
Thanks.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-01-2007, 06:17 PM
Member
 
Join Date: Aug 2007
Posts: 15
yiweiang is on a distinguished road
Hi there,

Don't worry. Did you set the class path to your jdk bin? If not, right click on My Computer--System Properties--Advanced--Environment Variables. Look for the CLASSPATH variable. Then go and locate your java jdk's BIN directory, copy that directory in into your classpath variable. javac should now work.

Alternatively, you can install an IDE that often does this for you. I personally use NetBeans. And i believe that it sets the path automatically? Correct me if i'm wrong, i havent done an installation of netbeans in a while.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 08-15-2007, 09:15 AM
Member
 
Join Date: Aug 2007
Posts: 1
koskow is on a distinguished road
javac manual pathing
Here is what I did to make it work.

First... here was my helloworld2.java code
__________________________________________

/**
* The HelloWorldApp class implements an application that
* simply prints "Hello World!" to standard output.
*/
class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Hello World!"); // Display the string.
}
}

___________________________________________
I had my helloworld2.java on my desktop.

My javac app is located at: c:\program files\java\jdk1.6.0_02\bin

Here is the code I used in the command line (typed cmd in my search bar under the start menu (vista) or from "Run" in XP to get command line running)

cd.. until I was at the root of C:

C:> "\Program Files\Java\jdk1.6.0_02\bin\javac" c:\Users\Kevin\Desktop\helloworld2.java

What this line of code does is tells the computer to use the javac program, located in the \Program Files\Java\jdk1.6.0_02\bin\ directory to compile the next item, which is the java script located on my desktop. - helloworld2.java

This should work on vista

This isn't a bandaid. It is normal command line stuff. You can path it differently as stated in the last post, so the application always knows to use the javac program when called, no matter what directory tou are in.

For instance, if you type "notepad" into the command line, in any directory, the application notepad.exe will launch.

I hope this helps.

Last edited by koskow : 08-15-2007 at 09:16 AM. Reason: pathing spelt wrong in title
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Indexing starting with 1 ravian New To Java 4 01-04-2008 02:03 PM
just starting specbailey New To Java 23 08-14-2007 01:25 AM


All times are GMT +3. The time now is 10:52 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org