Skip to main content

Basic Java programing problems

3 replies [Last post]
Miseb19
Offline
Joined: 2011-09-06
Points: 0

Hi!

I have started programing and I have downloaded these programs:
Java(TM) 6 Update 27
Java(TM) SE Development Kit 6 Update 27
JCreator LE 2.50

So when I try to compile this simple program in Jcreator:

public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}

this message is shown:

Invalid command line. Error : Invalid path
Command : \bin\javac.exe -classpath "C:\Program Files\Java" "C:\Program Files\Java\helloworld.java"
Directory : C:\Program Files\Java

What do I do?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
phil1234
Offline
Joined: 2011-07-15
Points: 0

You have to add the path of your JDK to the PATH variable, for example C:\Program Files\Java\jdk1.6.0_03\bin\

However, I used JCreator when I started to learn Java too, but I would recommend the Eclipse IDE (http://www.eclipse.org/downloads/packages/eclipse-classic-37/indigor). That's a very good editor with many plug-ins and features and used by a lot of programmers.

Miseb19
Offline
Joined: 2011-09-06
Points: 0

Hi!

I did what you told me and it works. Thanks a lot!
You are not the first to recommed Eclipse and I know it is better but we are using JCreator in school that is what I´ll be using for now.

Once again, Thank you!

phil1234
Offline
Joined: 2011-07-15
Points: 0

You're welcome :)