LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 04-05-2006, 02:02 AM   #1
vmlinuz.gz
Member
 
Registered: Nov 2005
Posts: 123

Rep: Reputation: 15
java.util.*; in Linux?


I'm a first year programming student, so bear with me on this one.

I've been programming on Windows (JCreater) because that's what we mostly use in class. However, I wanted to try writing a program on Linux this time to see what it's like. So far, it's been going very smoothly compared to Windows (as you might expect), except javac/gij cannot seem to find the Scanner class:

Code:
*** Semantic Error: Type "Scanner" was not found.
I made sure that I had "import java.util.*;" in my file. So, what's wrong?
 
Old 04-05-2006, 03:08 AM   #2
Mega Man X
Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 63
Hi!!!

You might want to install the Sun's JDK instead of gcj-java. gcj-java is still very bad and as far as I know, it does not support Java 5 (and I think the Scanner is a Java 5 feature).
 
Old 04-05-2006, 01:56 PM   #3
vmlinuz.gz
Member
 
Registered: Nov 2005
Posts: 123

Original Poster
Rep: Reputation: 15
Thanks Mega Man X, I can now use Scanner. I wonder why gcj isn't mature yet.
 
Old 04-05-2006, 03:26 PM   #4
Mega Man X
Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 63
No problems vmlinuz.gz . I'm sure gcj will catch up though. Open-source projects are developed at amazing steps. I keep my fingers crossed for gcj though. Java is my preffered programming language, but I dislike it's portability (it will run only where Sun wants it to run, for example). If gcj reaches an usable stage, java could be used more widely, from operating systems such as BeOS up to, who knows, game/consoles programming.

However, the way gcj is today, it's better to stick with Sun Java SDK though :\ (but still keep an eye on gcj progresses )

Best of luck!

Last edited by Mega Man X; 04-05-2006 at 03:36 PM.
 
  


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
Searching for util-linux sources cbonar Mandriva 6 11-18-2004 08:05 AM
Encrypted filesystems and util-linux thebell Linux - General 2 05-31-2004 11:16 AM
Java can't find package, but PATH set correctly (j2se1.4.0, java.util.regex package) Ethan Programming 5 02-06-2004 10:55 PM
util-linux cannot find any headers emu_123 Linux From Scratch 3 11-05-2003 05:19 AM
How do I install util-linux-2.10o rdaves@earthlink.net Linux - Newbie 1 05-27-2001 10:28 AM


All times are GMT -5. The time now is 12:57 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration