Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help getting an application to compile 1

Status
Not open for further replies.

mThomas

Instructor
May 3, 2001
404
US
I have installed Java 2 Develpment Kit Standard Version 1.4.2_02 on my computer. I am using Sam's Teach Yourself Java 2 in 21 days. One of the first coding tasks is to copy some code in the book and save it, "[...] into a folder you are using to work on programs for this book." The next instruction is as follows:

"If you are using the Software Development Kit, you can do the following to compile the program: Go to a command line or open a command-line window, open the folder where VolcanoRobot.java was saved, and then compile the program by typing the following command at the command line:

javac VolcanoRobot.java"

I can open the Java Web Start program, however I don't see an option to get to a command line. So I figure the book wants me to open a DOS window and navigate to the folder in which I saved the VolcanoRobot.java file. When I do so and attempt to compile the .java file, I get an error message indicating that the javac is not a valid command prompt.

Is the book telling me to open a DOS window?
Is there a command line option in the Java web Start?

When I installed the Java Dev Kit I used the default paths.

Do I need to save any .java files in a particular folder?

Instead of downloading the Java 2 Dev Kit for free, I purchased it from Sun. I did so thinking that if I had any issues, I would be entitled to some form of live tech support. I'm sad to report that Sun wants more money from me for support of any kind, except if I claim the install did not go properly.

All I want to do is get through the first compile. I can't seem to do that. What am I doing wrong?

Any help will be appreciated!

tia...mike
 
Ok so

1) Yes, you are right to be in a DOS window
2) If the javac is not in your path you must use the full path to it. Usually something like c:\Sun\jdk\bin\javac (check your own paths)

You can also use an environment variable shortcut that gets set on install, check your environment vars.

I recommend an IDE like Eclipse, it makes a lot of this much easier!

 
Ok...I have a resolution. Of course it was a path issue. Here is what happened.

1. I installed the jdk
2. I was notified of an update
3. I installed the upadate
4. I try to compile an application

When I first installed the jdk it was installed in the root of the C drive. When I installed the updated version (remember I used the default paths both times) it was installed in the Program Files folder. Interestingly enough it (the update) installed 3 versions in the Program Files\Java folder.

When I use the following it works great:

c:\jsdk1.4.2_02>path=%path%;C:\jsdk1.4.2_02\bin

c:\jsdk1.4.2_02>javac VolcanoRobot.java

If I try the same thing in the Programs Files\Java version, it doesn't work. I'm not sure why, but at least I'm up and running.

I did download and install the Eclipse IDE. For turning me on to that I giving siberian a star! I figured out what had happened because of the setup procedure for Eclipse.

Thanks!!!!

mike


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top