LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   can't get started with java (https://www.linuxquestions.org/questions/debian-26/cant-get-started-with-java-191597/)

sterrenkijker 06-09-2004 02:02 PM

can't get started with java
 
Hello world!

I want to start programming java, but I'm quite a programming newbie, and I don't know much about java. I installed some javapackages (java2-common, java-common, gcj and dependencies) and I also have some more compilerstuff installed, as I have written some very simple c++ programs (succesfully). I think my problem is quite stupid and simple actually:

I followed the instruction at http://java.sun.com/docs/books/tutor...va/unix.html#3 (didn't install that packages there, I want to use the Debian packages) and wrote the program "Helloworld". I compiled it with "javac HelloWorldApp.java" what created a file HelloWorldApp.class. But then? The command java is not found and I've also tried "javah HelloWorldApp.class" but I get the error "HelloWorldApp.class: no such class".

I probably just don't have the right package installed, but I don't know which package to install... Can anyone help me?

Corien

Nis 06-09-2004 02:17 PM

Try just
Code:

java HelloWorldApp
Also, in Java it standard practise to name the file the exact name of the class.

mrcheeks 06-09-2004 06:15 PM

i suggest you remove gcj and use another jdk
see http://www.debian.org/doc/manuals/de...-faq/ch11.html

i suggest the latest jdk from sun, ibm or blackdown
for the editors vim, emacs or eclipse
adding java and javac to your path won't hurt : bashrc , .cshrc or zshrc for whichever shell you use.

if you understand well the concept of classes packages, javabeans, inheritance, classes, interfaces you won't have any problems learning faster when you'll try to build your own applications.

java swing is not that easy but is worth it for gui applications
jakarta is a good place for the server stuff(dynamic web pages)

java is case sensitive like in unix.

sterrenkijker 06-11-2004 05:17 AM

Hi MrCheecks and Nis,

I've been fooling around a bit and finally installed the java sdk1.4.2 binary from sun. Now java finally works in my browser (opera). I've also got the HelloWorldprogram working. It has cost me all a lot of time, and I really can't track anymore what could have gone wrong. Java is quite confusing... I know what I can do this vacation :).

As for javaswing and jakarta, I'll find it out later maybe. I really am a totally java-newbie.

Thanks for you help,

Corien

atmguy 06-14-2004 06:02 AM

Sun does not allow anybody to re-distribute their JDKs
So you will not find any Debian packages for JDK, JSDK etc.
There are some scripts which will dowload the .bin file from sun and build a .deb package for installation
you can try http://z42.de/debian/

sterrenkijker 06-14-2004 02:06 PM

euhm, thanks, but I already have it installed and it works. But it could be usefull in the future, or for anyone else with the same problem :)


All times are GMT -5. The time now is 09:38 PM.