Forums Register Login

I'm having trouble with Java 1.6

+Pie Number of slices to send: Send
I'm trying to compile and run a test program from the command window.
In order for it to work I have to put the entire directory location and "HelloWorld.java" at the C prompt.
Is there something wrong with 1.6 that I can not simply use "javac HelloWorld.java" and "java HelloWorld"?

I have to input:
C:\Program Files\Java\jdk1.6.0\bin>javac c:\JavaProjects\HelloWorld2.java

C:\Program Files\Java\jdk1.6.0\bin>java HelloWorld2
Hello, World

for it to work!!!
+Pie Number of slices to send: Send
Hi,

Welcome to JavaRanch!

We have a strict policy on display names, which must be a real first and last name with a space between.

Please go here and fix your display name up, pronto. Thanks, pardner!

As far as your "problem" -- the argument to javac is and has always been a path to a file, relative to the current directory. This is nothing new with JDK 1.6.

You might find this helpful, as well as this. A properly configured system makes working with Java much easier.
+Pie Number of slices to send: Send
Ernest this is not your jurisdiction according to the moderator list.
Thanks, so I guess all this time when I simply input javac helloworld.java it has already been set up for me.
+Pie Number of slices to send: Send
 

Originally posted by dawud alexander:
Ernest this is not your jurisdiction according to the moderator list.



Here's another link for you.
Something must be done about this. Let's start by reading this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 912 times.
Similar Threads
how to enter password once, in code, for url database access
println
HelloWorld will not compile
Problem with JDK at command prompt
Compiling with javac and -cp
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 06:22:42.