LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-01-2004, 03:58 AM   #1
cyborg_jt
Member
 
Registered: Jan 2004
Location: New Zealand
Distribution: 2.6.11-gentoo-r3
Posts: 120

Rep: Reputation: 15
java programming on linux


Im kind of wanting to learn java but have been so excited about using linux (Mandrake 9.2). I use BlueJ a debuging app for java.
How can I porgram java in Linux?
 
Old 02-01-2004, 04:14 AM   #2
khtse
Member
 
Registered: Sep 2003
Location: Hong Kong
Distribution: Slackware 9.1
Posts: 43

Rep: Reputation: 15
I think the first step would be to install the latest java SDK... from java.sun.com.. Then, buy a few books on the subject, or go through the Java Tutorial at the java.sun.com site.

Seeing as how Java is meant to be platform-independent (which USUALLY is the case and can be trusted), there isn't any difference from java in linux to any other O/S....

=]
 
Old 02-01-2004, 05:41 AM   #3
Dominik
Member
 
Registered: Nov 2003
Distribution: slackware9.1/freebsd5.2
Posts: 53

Rep: Reputation: 15
Hi,

i'm actually learning java with "thinking in java" (you can download it for free at
www.briuceeckel.com).

It's much more detailed than the sun tutorial.
 
Old 02-01-2004, 08:43 PM   #4
german
Member
 
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Debian etch, Gentoo
Posts: 312

Rep: Reputation: 30
The Sun tutorials on Swing are very good, though I agree their core programming ones are not great. Check these two:

http://java.sun.com/docs/books/tutorial/uiswing/
http://java.sun.com/products/jlf/ed2/book/index.html
 
Old 02-02-2004, 05:19 PM   #5
cyborg_jt
Member
 
Registered: Jan 2004
Location: New Zealand
Distribution: 2.6.11-gentoo-r3
Posts: 120

Original Poster
Rep: Reputation: 15
I think I downloaded the wrong one on the java.sun site
The file name is j2eesdk-1_4-dr-linux-eval 130mb (took me 13hrs to downlad)
how do I install this, I can't find instructions on the site
 
Old 02-02-2004, 06:43 PM   #6
adflynn
Member
 
Registered: Jan 2004
Location: Runcorn, England
Distribution: Ubuntu Dapper Drake Tester
Posts: 34

Rep: Reputation: 15
Your probably best downloading the J2SE (Java 2 Standard Edition) SDK, the RPM for Linux is about 32mb.
 
Old 02-02-2004, 07:37 PM   #7
cyborg_jt
Member
 
Registered: Jan 2004
Location: New Zealand
Distribution: 2.6.11-gentoo-r3
Posts: 120

Original Poster
Rep: Reputation: 15
bugger!
 
Old 02-02-2004, 07:55 PM   #8
khtse
Member
 
Registered: Sep 2003
Location: Hong Kong
Distribution: Slackware 9.1
Posts: 43

Rep: Reputation: 15
There are several versions of the Java SDK, for different situations. The J2EE own that you downloaded is for enterprise servers, with support for Servlets/JSP and other high-end network application stuff. You should be using the J2SE first, as that is the bare-bones platform.

FIY, there's also a J2ME, which is the Micro Edition, for running Java on devices such as PDAs and mobile phones.
 
Old 02-02-2004, 09:01 PM   #9
moeminhtun
Member
 
Registered: Dec 2002
Location: Singapore
Distribution: Fedora Core 6
Posts: 647

Rep: Reputation: 30
Basically, after you download and install JDK and stuffs like that, the core Java programming is the same on both windows and Linux.

This site will also be helpful to you.
http://java.moeminhtun.com
 
Old 02-03-2004, 02:19 PM   #10
cyborg_jt
Member
 
Registered: Jan 2004
Location: New Zealand
Distribution: 2.6.11-gentoo-r3
Posts: 120

Original Poster
Rep: Reputation: 15
I installed it but I can not run javac unless I go /home/me/j2sdketc/bin/javac
How do I just make it so that I just type javac
I installed as a user not as root, should I have installed as root?
 
Old 02-03-2004, 06:49 PM   #11
moeminhtun
Member
 
Registered: Dec 2002
Location: Singapore
Distribution: Fedora Core 6
Posts: 647

Rep: Reputation: 30
You need to add your J2SDK bin directory to the PATH.

export PATH=$PATH:/home/me/j2sdketc/bin
 
Old 02-03-2004, 07:17 PM   #12
adflynn
Member
 
Registered: Jan 2004
Location: Runcorn, England
Distribution: Ubuntu Dapper Drake Tester
Posts: 34

Rep: Reputation: 15
Thanks moeminhtun thats solved my problem aswell.
 
Old 02-04-2004, 12:33 AM   #13
cyborg_jt
Member
 
Registered: Jan 2004
Location: New Zealand
Distribution: 2.6.11-gentoo-r3
Posts: 120

Original Poster
Rep: Reputation: 15
Yes thanks anyway
I did it another way

PATH=/home/me/j2sdk/bin:$PATH
 
Old 02-04-2004, 03:25 AM   #14
cyborg_jt
Member
 
Registered: Jan 2004
Location: New Zealand
Distribution: 2.6.11-gentoo-r3
Posts: 120

Original Poster
Rep: Reputation: 15
Im trying to do this


class Hello
{
public static void main (String[] args)
{
int minute, hour;
minute = "59";
hour = "11";
System.out.print ("The time is ");
System.out.print (hour);
System.out.print (":");
System.out.print (minute);
System.out.print (".");
}
}
but it doesn't work says "incompatible types - found java.lang.String but expected int"

If I use string it goes but why not with a integer?
 
Old 02-04-2004, 03:44 AM   #15
Nic-MDKman
Member
 
Registered: Feb 2004
Location: Sacramento, CA, USA
Distribution: Mandrake 9.2
Posts: 159

Rep: Reputation: 30
Wow, it has been way too long since I did any coding in Java if I cant answer that easy question. I know that it is because of the way your value is assigned. The error message states that pretty clearly, that is one great thing about java compilers. It says it was expecting an integer, but you gave it a string. If I remember correctly, when assigning a value to an integer variable you dont use quotes. I am not certain because it has been too long That, and when I write code I dont even think about the basics anymore, I just do them.

Your question is not even close to a linux question, that is just a mistake in your code.

Last edited by Nic-MDKman; 02-04-2004 at 03:48 AM.
 
  


Reply



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
Java Programming in Linux alexgsummer Programming 35 03-29-2005 09:03 AM
programming with java in linux? newbieX Linux - Newbie 9 12-30-2003 06:39 AM
Programming java in linux heming Linux - Software 4 02-28-2003 02:40 PM
Java programming in linux heming Linux - Newbie 4 02-28-2003 08:34 AM
Java programming in linux heming Linux - General 3 02-28-2003 08:32 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:19 PM.

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
Open Source Consulting | Domain Registration