LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   LinuxAnswers Discussion (https://www.linuxquestions.org/questions/linuxanswers-discussion-27/)
-   -   DISCUSSION: Beginning with Java (https://www.linuxquestions.org/questions/linuxanswers-discussion-27/discussion-beginning-with-java-78915/)

darin3200 08-04-2003 12:21 PM

DISCUSSION: Beginning with Java
 
This thread is to discuss the article titled: Beginning with Java

Steve Cronje 08-04-2003 02:41 PM

Re: DISCUSSION: Beginning with Java
 
I have just skimmed the article, and it looks great. I will go through it in more detail later.

As someone who has been starting with Java only recently, these suggestions may come in handy to other beginners such as I:

1. By all means get a sophisticated IDE such as Netbeans or Eclipse, play around with it, and build a few apps, THEN PUT IT AWAY. It only gets in the way of learning the basics.

2. Download DrJava, which is a very simple, yet very supportive learning environment, and much easier to be productive in than using 'just' a text editor. It is open source, free, and is written in Java.

3. Download the full documentation from Sun. The API is here

4. Download, and work through Thinking in Java which is a free download, and will teach you tons.

Just my 2p

HTH
Steve

then 08-05-2003 03:02 AM

Hi

Well written article :), bad formatting though. Had a tough time reading.

A couple of spaces and some para-breaks would be welcome.

regards
theN

darin3200 08-05-2003 08:01 PM

Yeh, I probably should have put some more formatting in.

glj 09-03-2003 10:37 AM

It might be worthwhile to include a link to Blackdowns' site to download Java Linux stuff from. The site has links to loads of useful sounding programs too :)

glj

Neodymium 03-10-2004 04:33 PM

A nice introduction, I'll be doing some Java development at college next year, and it's always nice to be ahead of the game.

AskMe 04-24-2004 05:37 AM

What are the commands to run and compile!!!
 
I can say, it is good for beginers, but it lacks important fact, like what the command one should issue to compile these codes on Linux, and how one can see the output? It would be better if you include such topics.

darin3200 04-24-2004 11:53 AM

Yeh, i guess I took it for granted that I knew the commands but 'javac' for compile and 'java' for running

AskMe 04-26-2004 06:08 AM

Thanks, but I was looking for different thing!!
 
Yah, most know how to compile java source file with javac filename.java and run the compiled class file with java filename, but I was looking for different thing. I have installed Red Hat Linux 9, and with that there is free GNU, compiler and class file interpretor. After hard try, I found out how to use gcj and gij. So here is the command how to compile java on RedHat9.

To compile source file(filename.java)
gcj -C filename.java

To run calss file (filename.class)
gij filename

I hope this will help people like me, but I am still looking for how to run Applet on RedHat 9, I don't want to use Mozilla, because there is no plug-in installed and to install all these another headache for me as I know very less about linux.

lmellen 06-05-2004 02:40 PM

I've worked all the example programs up to class moon.The class moon program won't compile. I get:

ex6.java:16: cannot resolve symbol
symbol : method readline()
location: class java.io.BufferedReader

Then there is a ^ under the first new in the following line:

String strA = new BufferedReader(new InputStreamReader(System.in)).readLine();

Just wondering why it won't compile. No big deal, but a reply would be interesting.-- Thanks- Larry (I haven't been able to solve this problem)

darin3200 06-08-2004 04:39 PM

Have you typed this up the code yourself or have you tried copying and pasting into the .java file? Some times there can be typos that have an effect of the compilation of the programs. I'll check that out though.

lmellen 06-08-2004 11:06 PM

darin3200 -- I tried again, thus time using Gentoo, I get the same result.
Last time I used Fedora Core 2. I'm using j2sdk1.4.2_04 on
both systems. -- Thanks for the reply -- Larry

darin3200 07-01-2004 10:12 AM

Quote:

Originally posted by lmellen
darin3200 -- I tried again, thus time using Gentoo, I get the same result.
Last time I used Fedora Core 2. I'm using j2sdk1.4.2_04 on
both systems. -- Thanks for the reply -- Larry

Sorry it took so long to reply, I just saw this post today. I'm not sure what is going wrong, I am currently emerging j2sdk on my fresh gentoo install but I tried compiling it on j2sdk1.4.2_04 under Windows 2000 Pro and it worked fine. I'll try compiling it again under Gentoo once j2sdk is installed and get back to you.

v1pEr 03-03-2005 10:51 AM

A good introduction!

Baz8080 04-06-2005 03:58 PM

True, nice article, but the formatting is confusing - especially for beginners. We should be teaching them to correclty format and indent code as this will serve them throughout their careers as programmers.

I also think that it is usually easier to read if you create one instance of the BufferedReader and re-use this.

so

Code:

BufferedReader keyboardInput = new BufferedReader(new InputStreamReader(System.in)))
and then reuse it

Code:

keyboardInput.readLine().....

vireshwali 11-07-2005 02:30 AM

Hi,
good for some basic starting, but for those intresed in a dive in the sea of java programming on linux go to tutorials at sun.java.com and start hunting.

It is best to download jdk for linux from sun and code in vi/vim/gvim and compile and run from console.

Beginners shall have a great time deciphering the myteries. Do also remember to view the API of your specific jdk version download at sun. The API is what i will call the java programmers bible.


Happy learning.

rock_till_456 02-24-2006 05:21 AM

Quote:

Originally Posted by lmellen
I've worked all the example programs up to class moon.The class moon program won't compile. I get:

ex6.java:16: cannot resolve symbol
symbol : method readline()
location: class java.io.BufferedReader

Then there is a ^ under the first new in the following line:

String strA = new BufferedReader(new InputStreamReader(System.in)).readLine();

Just wondering why it won't compile. No big deal, but a reply would be interesting.-- Thanks- Larry (I haven't been able to solve this problem)

--------------------------
first have you copy pasted teh moon d\code and tried it out bcos it works i have tried that with jdk 1.5 version it compiled perfectly

if the error is still there just try to resolve the method bcos readline() is a method availbale in BufferReader , so check first check by just calling by BufferReader object

abraham lemma 06-04-2007 07:28 AM

hi
 
linux documentation

sugitha 11-12-2008 03:54 AM

Very good article. As a learner of Java, this is helpful for me.

sugitha 11-24-2008 10:37 PM

This will be helpful for run an applet program
appletviewer filename.html

mikese 04-01-2009 12:18 PM

Anyone building apps for IMG networks should check out diameter IMS it's used in so many apps. I just started building with it.

vjmac 10-07-2009 05:58 PM

Quote:

Originally Posted by then (Post 409803)
Hi

Well written article :), bad formatting though. Had a tough time reading.

A couple of spaces and some para-breaks would be welcome.

regards
theN

When's the update?

AeonX 12-19-2009 11:57 AM

are java commands in linux different from the java commands in windows?

devnull10 01-10-2010 10:06 AM

Quote:

Originally Posted by AeonX (Post 3798060)
are java commands in linux different from the java commands in windows?

99% of the time, no, however there may of course be certain situations where a program has been written for linux which will not compile/run on windows because some platform-specific code exists - it could be something as simple as a file location - a hard-coded /home/me/file.txt ain't going to get you far in windows. :)

SusanRaj 01-26-2013 04:45 AM

How to implement User Authentication using servlet filters ?
 
Read my tech blog for User Authentication using servlet filters

Sudy9 08-18-2013 08:18 AM

Great article for the java begineers

danliston 08-03-2014 05:48 PM

Match correction to triangle example code
 
When you test b == 0, you declare the b statement be b = a - c instead of b = c - a

Considering a squared plus b squared equal c squared, C is always larger than A or B,
wouldn't this fact mitigate the need to test either A or B for a negative value? The
text book example of a right triangle is a=3, b=4, c=5; squared, 9=25-16 and 16=25-9

Any number squared becomes a positive. You only subtract a smaller square from a
larger square. It should be impossible for the difference to ever be a negative
value.

ntubski 08-11-2014 01:45 PM

Quote:

Originally Posted by danliston (Post 5214335)
Considering a squared plus b squared equal c squared, C is always larger than A or B,
wouldn't this fact mitigate the need to test either A or B for a negative value?

There is nothing in the code that constrains C to be the hypotenuse (the side opposite the right angle, i.e. the longest side). Suppose the user enters a=5, c=3.

JDoes 03-27-2020 11:45 PM

FFW To the future!!!
 
I have been learning Java through Udemy lately. Anyone have a recommendation for applying Java to mobile development?
Im really loving this Java stuff a lot, and looking forward to learning and applying it even more!!! Maybe I can develop
my own mobile app to help my students learn physics!!!


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