Skip to main content



      Home
Home » Newcomers » Newcomers » Newcomer
Newcomer [message #245455] Mon, 14 January 2008 01:06 Go to next message
Eclipse UserFriend
Originally posted by: volunteer.bokss.org.hk

In Eclipse, I can't even get import java.io.Console to compile
I know that you have to set some directories.
But don't know which ones they are....
Could you please divert me to the right group if there is one?
Thx
Jack
Re: Newcomer [message #245460 is a reply to message #245455] Mon, 14 January 2008 01:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: volunteer.bokss.org.hk

My code is like this:
package Try2;

import java.io.Console;
import java.sql.SQLException;

public class MainClass {
public static void main(String[] args){
Console console = System.console();
if (console == null) {
System.err.println("sales: unable to obtain console");
return;
}

String username = console.readLine("Enter username: ");
System.out.println(username);
}
}
/////////////////////////////////////////////////////
You could see my log, but it was incrediably lengthy.
So I gave up.

Any comments are welcome!
Jack
Re: Newcomer [message #245463 is a reply to message #245460] Mon, 14 January 2008 02:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wharley.bea.com

"Jacky Luk" <volunteer@bokss.org.hk> wrote in message
news:699ded0f616767b0df25aa665b9139ab$1@www.eclipse.org...
> My code is like this:
> package Try2;
>
> import java.io.Console;
> import java.sql.SQLException;
>
> public class MainClass {
> public static void main(String[] args){
> Console console = System.console();
> if (console == null) {
> System.err.println("sales: unable to obtain console");
> return;
> }
>
> String username = console.readLine("Enter username: ");
> System.out.println(username);
> }
> }
> /////////////////////////////////////////////////////
> You could see my log, but it was incrediably lengthy.
> So I gave up.
>
> Any comments are welcome!


This is an appropriate group for this question. However, without knowing
what errors you are getting, or what steps you took to configure your
project, it is not really possible to answer.

Have you tried running through any of the Eclipse tutorials, or creating a
project with one of the project templates? Perhaps that would help you get
the hang of configuring a Java project correctly. As you say, the problem
is probably that your Java Build Path (aka "classpath") is not properly set.

By the way, it is often helpful to give your postings a descriptive subject.
Something like "can't get code to compile" would be more helpful than
"newcomer" for this message. Try to come up with a title that distinguishes
your post from all the others!
Re: Newcomer [message #245484 is a reply to message #245460] Mon, 14 January 2008 06:36 Go to previous message
Eclipse UserFriend
Hi Jacky,

According to http://java.sun.com/javase/6/docs/api/
java.io.Console is part of javase 1.6. So if you use an older jre
java.io.Console won`t be found.

What jdk of jre are you using?.

You can see this from Windows->Preference->Java->Installed JREs.

Best Regards,
Kiril

Jacky Luk wrote:
> My code is like this:
> package Try2;
>
> import java.io.Console;
> import java.sql.SQLException;
>
> public class MainClass {
> public static void main(String[] args){
> Console console = System.console();
> if (console == null) {
> System.err.println("sales: unable to obtain console");
> return;
> }
>
> String username = console.readLine("Enter username: ");
> System.out.println(username);
> }
> }
> /////////////////////////////////////////////////////
> You could see my log, but it was incrediably lengthy.
> So I gave up.
>
> Any comments are welcome!
> Jack
>
>
>
Previous Topic:Half English Half Chinese
Next Topic:Importing an existing project - how to organise
Goto Forum:
  


Current Time: Fri Jun 13 09:06:40 EDT 2025

Powered by FUDForum. Page generated in 0.08224 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top