GIDForums  

Go Back   GIDForums > Computer Programming Forums > Java Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 21-Aug-2009, 13:22
jocatix jocatix is offline
New Member
 
Join Date: Aug 2009
Posts: 3
jocatix is on a distinguished road

Java will not work on Windows Vista


ok, so im in a computer class and for the love of money i can not get java to work at all.

Here is my post, sorry for speed, ill try and keep it short.

Ok so i downloaded jdk1.6.0_16 last night. I installed and all was going well, after install i got the path which is

C:\Program Files\Java\jdk1.6.0_16\bin

put that in the path area proceeding some other stuff that was already written there.

From there i did the obvious and wrote Hello World, saved that as HelloWorldApp.java saved as text through Notepad (saved on desktop)

upon that i went to CMD, and started cd Desktop, then proceeded to javac HelloWorldApp.java in which case it says javac is not a recognized command.

Im lost
  #2  
Old 21-Aug-2009, 19:06
TurboPT's Avatar
TurboPT TurboPT is offline
Senior Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 1,140
TurboPT is a jewel in the roughTurboPT is a jewel in the roughTurboPT is a jewel in the rough

Re: Java will not work on Vista, please help!


Can you give more detail as to how/where the path change was applied?

Would you mind posting the entire path here?

The last part seems about changing to the desktop to compile is ok, but the path may not still be correct.

From the prompt at the desktop, you could also provide the full path to javac executable to attempt a compile:

Example:
C:\User\turbo\desktop>"\Program Files\Java\jdk1.6.0_16\bin\javac" HelloWorldApp.java

Of course, doing it that way every time is annoying until the path is corrected.
__________________
Use the force...read the source!!
WYCIWYG -- what you code is what you get!
  #3  
Old 22-Aug-2009, 07:24
Mexican Bob's Avatar
Mexican Bob Mexican Bob is offline
Member
 
Join Date: Mar 2008
Location: Chicxulub, Yucatán
Posts: 226
Mexican Bob is a jewel in the roughMexican Bob is a jewel in the roughMexican Bob is a jewel in the rough

Re: Java will not work on Vista, please help!


Quote:
Originally Posted by jocatix
C:\Program Files\Java\jdk1.6.0_16\bin

Do:

Windows Key + Break Key

Click or Tab/Arrow Keys to the "Advanced" tab

ALT + n (Environment Variables Tab)

ALT + n (New user environment variable)

ALT + n (Name...or just start typing)

Use the following variable name:

JAVA_HOME (press tab or ALT + v for Value)

Enter: C:\Program Files\Java\jdk1.6.0_16

Press Enter or click OK button

IF exists a variable named PATH edit it otherwise create it using the same basic steps as above, but modify the Value to:

%PATH%;%JAVA_HOME%\bin

**if** editing, add ';%JAVA_HOME%\bin' (without single quotes) to the END of your PATH environment variable Value.


...click OK until you're out of the series of dialogs.


Windows + r (Run)

Type:

cmd (press enter)

At the prompt type:

javac (press enter)

You should see something like:

Code:
C:\Documents and Settings\MxB>javac Usage: javac <options> <source files> where possible options include: -g Generate all debugging info -g:none Generate no debugging info -g:{lines,vars,source} Generate only some debugging info -nowarn Generate no warnings -verbose Output messages about what the compiler is doing -deprecation Output source locations where deprecated APIs are used -classpath <path> Specify where to find user class files and annotation processors -cp <path> Specify where to find user class files and annotation processors -sourcepath <path> Specify where to find input source files -bootclasspath <path> Override location of bootstrap class files -extdirs <dirs> Override location of installed extensions -endorseddirs <dirs> Override location of endorsed standards path -proc:{none,only} Control whether annotation processing and/or compilation is done. -processor <class1>[,<class2>,<class3>...]Names of the annotation processors to run; bypasses default discovery process -processorpath <path> Specify where to find annotation processors -d <directory> Specify where to place generated class files -s <directory> Specify where to place generated source files -implicit:{none,class} Specify whether or not to generate class files for implicitly referenced files -encoding <encoding> Specify character encoding used by source files -source <release> Provide source compatibility with specified release -target <release> Generate class files for specific VM version -version Version information -help Print a synopsis of standard options -Akey[=value] Options to pass to annotation processors -X Print a synopsis of nonstandard options -J<flag> Pass <flag> directly to the runtime system

Locate/edit your source code to be something like:

JAVA Code:
class Hello {
  public static void main(String[] args) {
    System.out.println("Hello, Java.");
  }
}

Compile command:

C:\src\java>javac Hello.java


...then you only have to solve your invocation of your classpath.


Output:

Code:
C:\src\java>java -cp %JAVA_HOME%\lib;. Hello Hello, Java.


Alternatively, you can create another environment variable named CLASSPATH and assign its value to %JAVA_HOME%\lib;.

...however, this may be considered a security risk.


MxB
  #4  
Old 23-Aug-2009, 22:30
jocatix jocatix is offline
New Member
 
Join Date: Aug 2009
Posts: 3
jocatix is on a distinguished road

Re: Java will not work on Vista, please help!


Quote:
Originally Posted by TurboPT
Can you give more detail as to how/where the path change was applied?

Would you mind posting the entire path here?

The last part seems about changing to the desktop to compile is ok, but the path may not still be correct.

From the prompt at the desktop, you could also provide the full path to javac executable to attempt a compile:

Example:
C:\User\turbo\desktop>"\Program Files\Java\jdk1.6.0_16\bin\javac" HelloWorldApp.java

Of course, doing it that way every time is annoying until the path is corrected.
you mean this?

C:\Program Files\Java\jdk1.6.0_16\bin thats my path?
 
 

Recent GIDBlogToyota - 2009 May Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
.NET, Java, or C++? ironspider Miscellaneous Programming Forum 1 21-Apr-2009 01:22
What is the equivalent in Java for a Function or Module in VB pengwinz Java Forum 2 17-May-2007 21:02
Random access files Krazy_yA C Programming Language 6 07-May-2006 02:44
help with coding for a Java newbie!!! sammy78 Java Forum 0 04-Apr-2006 08:52
Scalability in Java and C++ agx Miscellaneous Programming Forum 7 04-Feb-2006 16:35

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 19:00.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.