• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

installing java

 
Dylan Moore
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't figure out to make the permanent path to my bin. I'm running windows xp. I've looked at environment variables but and tried changing them but there has no difference. What should i do? Thanks
 
Jim Kiley
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After you change an environment variable in Windows, make sure to close and restart any other windows you might be using which need to take advantage of that environment variable. Those other windows (programs or the command window) receive the values of environment variables when they are created.

Hope this helps,

jk
 
Rick O'Shay
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is always suspect because installation sets the path for you. Usually the problem is following bad advice found in most introductory books on java where they have you set the PATH and CLASSPATH -- the latter is always a mistake.

Make sure the bin directory is in your path and if so open a new command window and enter java -version. If you get a not found message it's not installed or it's not in your path; otherwise you should get the version string.
 
krish reddy
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have tried, start->run , type in sysedit, and then adding in the path namely c:\j2sdk\bin followed by ; saved the autoexec.bat file, and then restarted ur system
[ September 09, 2005: Message edited by: fallnlearn ]
 
Dylan Moore
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i still havent figured it out. im running it through netbeans though so im not exactly sure where plain j2sdk is and the bin is under netbeans. maybe that will make more since to u guys because i was trying what was said but it didnt work either.

ok update, i threw in a cd in front of the path i put in autoexec.bat and i think that fixed the problem. it changes dir with no problem now. i guess thats what its supposed to do. so hopefully thats it and i can actually start learning stuff.
[ September 09, 2005: Message edited by: Dylan Moore ]
 
Marilyn de Queiroz
Sheriff
Posts: 9066
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by fallnlearn:
have tried, start->run , type in sysedit, and then adding in the path namely c:\j2sdk\bin followed by ; saved the autoexec.bat file, and then restarted ur system


Hi, fallnlearn,

Welcome to JavaRanch! Please adjust your display name to meet the JavaRanch Naming Policy.
You can change it here.

Thanks!

Regarding your comment quoted above, this is the procedure for changing the path on Win9x. It won't do anything in WinXP.
 
Marilyn de Queiroz
Sheriff
Posts: 9066
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dylan Moore:
i still havent figured it out. im running it through netbeans though so im not exactly sure where plain j2sdk is and the bin is under netbeans. maybe that will make more since to u guys because i was trying what was said but it didnt work either.


I've never used netbeans, so I can't help you there. However, if you took the defaults when you installed the jdk, you can probably find the javac.exe file either at C:\j2sdk1.4.2_0x\bin (for version 1.4) or C:\Program Files\Java\jdk1.5.0_0x (for version 1.5/5.0).

This is set in WinXP by right-clicking on MyComputer and going to Properties. Somewhere in there is EnvironmentVariables where you can "edit" your PATH variable.

You may have to set it separately in the IDE.
[ September 10, 2005: Message edited by: Marilyn de Queiroz ]
 
Dylan Moore
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yea, netbeans has its own bin seperate from the bin for jdk1.5. which one should i be setting the path to?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know NetBeans so I can't help much there. Does NetBeans have something like the Eclipse dialog that lets you select a JDK from any that are installed? It can usually find them or you can browse directories to pick one.

See if THIS helps with running Java from the command line. It's good to know both techniques.
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dylan Moore:
yea, netbeans has its own bin seperate from the bin for jdk1.5. which one should i be setting the path to?


If you want to run your programs from the command-line, you need to include the jdk1.5 bin to the path. Adding the netbeans bin to the path only allows you to run NetBeans from the command-line, which you probably won't do since it's a lot easier to double-click the icon on your desktop.

On the other hand, if you are only running programs from NetBeans itself, you don't need to worry about the PATH at all.

Layne
[ September 11, 2005: Message edited by: Layne Lund ]
 
Raveendra Mutyala
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In autoexec.bat please add the path
PATH=%PATH%;C:\JDK1.4.2\BIN;c:\jdk1.4.2;
please verify the path in which ur java is loaded and the drive in which it is loaded
 
Dylan Moore
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, well ive almost got it working though i havent touched the autoexe.bat yet. im just trying to run a hello world app real quick but when i try to compile it i enter javac myfirstap.java in the directory where the app is saved. am i running it in the wrong directory because i keep getting this message many times... more than im going to paste... it says it cant find the class or interface.

myfirstap.java:1: illegal character: \92
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}}


heres how i have my variables set up

java_home is C:\Program Files\Java\jdk1.5.0_04
path is %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%java_home%\bin
classpath is .
[ September 14, 2005: Message edited by: Dylan Moore ]
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That looks like you may have edited your code with MS Word or WordPad or something that saved in RTF format. Open the source java file up in plain old NotePad or type it and see how it looks. In most other word processors or editors you can find an option to save as text; that will help if this is your problem.
 
Dylan Moore
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that almost fixed it, not its saying package system doesnt exist..

C:\Documents and Settings\Dylan Moore\My Documents>j
app.java:4: package system does not exist
system.out.println("I Rule!");
^
app.java:5: package system does not exist
system.out.println("The World");
^
2 errors
 
Marilyn de Queiroz
Sheriff
Posts: 9066
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that almost fixed it, not its saying package system doesnt exist..

C:\Documents and Settings\Dylan Moore\My Documents>j
app.java:4: package system does not exist
system.out.println("I Rule!");
^

Java is case-sensitive. System is not the same as system. Try using
System.out.println(("I Rule!");
and see what happens.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic