What is the best way to start creating java programs?

Caporegime
Joined
12 Mar 2004
Posts
29,962
Location
England
Everytime I try to use an ide I get errors like "cannot resolve symbol" "package system not setup" or something like that and I'm only trying to compile the hello world app! When I try to compile a notepad file I always get "javac is not a recognised command" even though I have set the environmental variables, I don't want to have to keep typing in the directory everytime I want to compile something either.

So can someone please tell me how to create java applications without having to setup loads of complicated things? It's bad enough having to install the sdk without settings up classes or whatever they are called. With C++ I just downloaded the devc++ ide and I could just go "new"---->"file" and start coding and compiling straight away. Is there any program that will allow me to do this for java?
 
Last edited:
manic_man said:
Eclipse might be a good way to start, or the Sun Netbeans IDE. Others exist such as JBuilder but a) they arnt free and b) JBuilder is terrible :p

I get those errors I mentioned when I use eclipse. Why can't java just be like c++ where it just works without setting anything up? It seems like java is actually more complicated than c++.

Even my instructor can't figure out why it isn't working!
 
Ok I've compiled the file using javac finally, but not when I type java to try to run it, it fails spectaculary again.

crap-java.JPG
 
NathanE said:
Compiling via the command line is not the best way to starting creating Java programs :p

You really should install an IDE, such as NetBeans or Eclipse :)

I said I already tried that and the errors I get with them, "cannot resolve symbol" and "package system not setup". I've been told though that I should start with the command line because it's good to know how to use it.

Una said:
Whats the error?


I already posted it.
 
Last edited:
In my variables I have

PATH

C:\J2SDK.1.4.2_13\BIN\

CLASSPATH

C:\; C:\J2SDK1.4.2_13\LIB\

I can't see anything obviously wrong with that? I used the guide from the oracle website.
 
It was the first link on google so I assumed it was the latest version. :p

God, downloading this is slow with bt's traffic shaping. :rolleyes:
 
Last edited:
Is there an easy guide on how to use these ides like netbeans and eclipse?

I've used about 4 different ones and I always get the same 2 errors everytime.

init:
deps-jar:
Compiling 1 source file to C:\Documents and Settings\Ash\JavaApplication1\build\classes
C:\Documents and Settings\Ash\JavaApplication1\src\helloworld\Main.java:3: cannot find symbol
symbol : class string
location: class helloworld
public static void main(string args[])
C:\Documents and Settings\Ash\JavaApplication1\src\helloworld\Main.java:5: package system does not exist
system.out.println("hello world");
2 errors
BUILD FAILED (total time: 2 seconds)
 
Una said:
Or hmm, has that error message made all your code lower case.. Java is case sensive you need String[] for a start, likewise System.out.println();

It compiles. :D However it doesn't run, just stops after it's says "build sucsessful".
 
I compiled and then pressed the run button.

It did say "to run this application from the command line without ant, try:". Does this ant have something to do with it not running?
 
Last edited:
Back
Top Bottom