Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Debian This forum is for the discussion of Debian Linux.


  Search this Thread
Old 06-09-2004, 03:02 PM   #1
Registered: Mar 2004
Location: the Netherlands
Distribution: Debian Sarge
Posts: 302

Rep: Reputation: 30
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 (didn't install that packages there, I want to use the Debian packages) and wrote the program "Helloworld". I compiled it with "javac" 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?

Old 06-09-2004, 03:17 PM   #2
Registered: Jul 2003
Location: Virginia
Distribution: Ubuntu Hoary (5.04)
Posts: 550

Rep: Reputation: 31
Try just
java HelloWorldApp
Also, in Java it standard practise to name the file the exact name of the class.
Old 06-09-2004, 07:15 PM   #3
Senior Member
Registered: Mar 2004
Location: far enough
Distribution: OS X 10.6.7
Posts: 1,690

Rep: Reputation: 52
i suggest you remove gcj and use another jdk

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.
Old 06-11-2004, 06:17 AM   #4
Registered: Mar 2004
Location: the Netherlands
Distribution: Debian Sarge
Posts: 302

Original Poster
Rep: Reputation: 30
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,

Old 06-14-2004, 07:02 AM   #5
LQ Newbie
Registered: May 2004
Location: Mumbai, India
Distribution: Debian, Sarge
Posts: 8

Rep: Reputation: 0
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
Old 06-14-2004, 03:06 PM   #6
Registered: Mar 2004
Location: the Netherlands
Distribution: Debian Sarge
Posts: 302

Original Poster
Rep: Reputation: 30
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting started carlosinfl Debian 9 02-01-2005 07:12 AM
need help getting started. ftbreak Slackware - Installation 1 01-31-2005 07:36 PM
Help Getting started reddog64 Linux - Newbie 9 04-18-2004 11:45 PM
Getting started, Daniel Linux - Newbie 2 07-23-2002 11:52 AM
Looks like it started neo77777 General 3 04-14-2002 04:56 PM > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 08:25 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration