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

Notices


Reply
  Search this Thread
Old 06-09-2004, 03:02 PM   #1
sterrenkijker
Member
 
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 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
 
Old 06-09-2004, 03:17 PM   #2
Nis
Member
 
Registered: Jul 2003
Location: Virginia
Distribution: Ubuntu Hoary (5.04)
Posts: 550

Rep: Reputation: 31
Try just
Code:
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
mrcheeks
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
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.
 
Old 06-11-2004, 06:17 AM   #4
sterrenkijker
Member
 
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,

Corien
 
Old 06-14-2004, 07:02 AM   #5
atmguy
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 http://z42.de/debian/
 
Old 06-14-2004, 03:06 PM   #6
sterrenkijker
Member
 
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
 
  


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

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

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