File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes installing java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "installing java" Watch "installing java" New topic
Author

installing java

Dylan Moore
Greenhorn

Joined: Sep 09, 2005
Posts: 5
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

Joined: Sep 09, 2005
Posts: 6
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

Joined: Sep 19, 2004
Posts: 531
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

Joined: Sep 09, 2005
Posts: 10
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

Joined: Sep 09, 2005
Posts: 5
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

Joined: Jul 22, 2000
Posts: 9044
    
  10
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.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
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

Joined: Sep 09, 2005
Posts: 5
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

Joined: Jan 29, 2003
Posts: 8791
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.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
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 ]

Java API Documentation
The Java Tutorial
Raveendra Mutyala
Greenhorn

Joined: Sep 10, 2005
Posts: 13
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

Joined: Sep 09, 2005
Posts: 5
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

Joined: Jan 29, 2003
Posts: 8791
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

Joined: Sep 09, 2005
Posts: 5
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

Joined: Jul 22, 2000
Posts: 9044
    
  10
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: installing java