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 I'm having trouble with Java 1.6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "I Watch "I New topic
Author

I'm having trouble with Java 1.6

Jay Dilla
Ranch Hand

Joined: Aug 12, 2004
Posts: 199
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!!!
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

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.


[Jess in Action][AskingGoodQuestions]
Jay Dilla
Ranch Hand

Joined: Aug 12, 2004
Posts: 199
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.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

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


Here's another link for you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I'm having trouble with Java 1.6
 
Similar Threads
Compiling with javac and -cp
HelloWorld will not compile
println
Problem with JDK at command prompt
how to enter password once, in code, for url database access