PDA

View Full Version : Java Newbie, Basic Questions-Probably




UserZero
Feb 23, 2009, 03:11 AM
Hello all and thanks for your advice in advance. So I'm learning Java and of course am using the Best Platform in the World to write the code on. :D . I have been using eclipse (and Editra some) but am wondering if anyone has any better suggestions on IDE's (not just good text editors).

I'm having an issue that my programs will run great on mac, but when I take them to a PC they(meaning anything I write) don't run at all, I always get an error (I don't think it even gives me an error I think they just don't run, it's been awhile).They are just some basic one frame GUI apps. I'm wondering if anyone else has run into this. I know I'm not putting any apple specific code into these things as they are mainly exorcises from a book written assuming that you would develop on a winblows box.

Thanks



wrldwzrd89
Feb 23, 2009, 08:46 AM
I prefer NetBeans as my Java IDE because of the fact that it automatically makes a redistributable JAR file for your application, AND handles all dependencies for you by putting them in a lib folder. This makes running Java applications on Windows (and Linux) much simpler, since all you have to do is double-click the JAR file.

Winni
Feb 23, 2009, 03:13 PM
Well, thanks to Apple's sincere disinterest, the Mac most certainly is NOT the best platform to develop Java applications on. And Java's multi-platform capabilities usually run down to "write once, debug everywhere" anyway - meaning that you always write your code for one specific VM and hope to make it run on this VM.

Netbeans has come a long way in the last years and matured a lot. It has gained a lot of popularity, but I nevertheless think that you should just stay with Eclipse. No matter how much marketing Sun puts behind Netbeans, Eclipse is what the biggest Java company in the world champions. And the biggest Java company is not Sun, the creator of the language, it's IBM.

toddburch
Feb 23, 2009, 06:30 PM
This usually works fine for me. What SDK are you using? Post a small sample of code that fails. How are you sending your class file to other op systems?

Burtonsnow9
Mar 10, 2009, 10:24 AM
You also may want to check simple things like whether or not you have java installed in the windows machine. Simple things are always killer haha.

AUFan
Mar 10, 2009, 01:27 PM
Hello all and thanks for your advice in advance. So I'm learning Java and of course am using the Best Platform in the World to write the code on. :D . I have been using eclipse (and Editra some) but am wondering if anyone has any better suggestions on IDE's (not just good text editors).

I'm having an issue that my programs will run great on mac, but when I take them to a PC they(meaning anything I write) don't run at all, I always get an error (I don't think it even gives me an error I think they just don't run, it's been awhile).They are just some basic one frame GUI apps. I'm wondering if anyone else has run into this. I know I'm not putting any apple specific code into these things as they are mainly exorcises from a book written assuming that you would develop on a winblows box.

Thanks

Are you making any calls to any Mac / UNIX graphics API's, or are you sticking to Swing for the GUI apps? If you're making any Mac specific calls in your program, the program will not work on Windows. The other thing to check is if Java is installed on the windows box and you have the right paths set up.

Since you do mention you don't have any Mac calls, try rewriting the code (not copying/pasting) on the windows box and seeing if it works/compiles and go from there. You may have to fiddle with the java path inside MS.