LinuxQuestions.org
Review your favorite Linux distribution.
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 04-05-2006, 01: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, 02:08 AM   #2
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 65
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, 12: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, 02:26 PM   #4
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 65
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 02:36 PM.
 
  


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

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

All times are GMT -5. The time now is 06:13 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