BlueJ

On my machine I am currently running Oracle 9i and BlueJ (Java). I believe Oracle installs its own JDK, BlueJ also does this.
When I am trying to run BlueJ, and I am trying to edit the code in a class, it doesnt let me open it, I believe it uses the wrong JDK (Oracle) and not BlueJ's.
Is it possible for me to select the right JDK? and how?

i need help. i need to know how to use arrays to store user input. I have so far, the following code.
import java.io.*;
import java.util.Scanner;
import java.util.*;
public class ReadConsole
public static void main(String[] args)
Scanner input = new Scanner(System.in);
System.out.println("Menu System - Please enter your choice");
System.out.println("Option 1");
System.out.println("Option 2");
System.out.println("Option 3");
for(int i = 0; i < 1; i++){
int num = input.nextInt();//
if(num==1){
System.out.println("Option 6");}
else if(num==2){
System.out.println("Option 7");}
else if(num==3){
System.out.println("Option 8");}
else{
System.out.println("Try again");
i = 0;
}

Similar Messages

  • Is there any way to send output in BlueJ to a .txt file?

    I want to send the output of my BlueJ program to a .txt file. Is there any command to do it? If yes, then please tell me the syntax of that command along with an example using it?

    Again, you're just misunderstanding the tools you're using. Java should do that, not BlueJ. You have to research this from the perspective of writing Java code to do it. If you search how to make BlueJ do it, you won't find it because BlueJ has nothing to do with it.
    So you know your basic requirements.
    - you use System.out
    - you want that to go to a file in stead of to the command prompt / BlueJ console
    Do you know how to work with files yet? If not, that would be something you need to learn right now. And after that, try a Google for "java System.out file" and see what you get.

  • BlueJ won't create a new object for me

    I'm using BlueJ 2.0.5 with Java 1.5.0 Update 4 and when I try to create an object from the BlueJ CD examples folder, the program says "Creating object...", but doesn't create the object and the "Creating object..." only disappears if I click somewhere in the screen.
    I also found an error message of some kind in the debugger. I found the following:
    "Listening for transport dt_socket at address: 2579"
    and
    "java.lang.NullPointerException
         at bluej.runtime.ExecServer$3.run(ExecServer.java:786)
    ERROR: transport error 202: recv error: Software caused connection abort ["transport.c",L41]
    ERROR: transport error 202: send failed: Software caused connection abort ["transport.c",L41]"
    Does anyone have any idea what is up here? BlueJ v2.0.1/3 and an older version of Java 1.5.0 work fine on my laptop. I intend to update both the Java and BlueJ on my laptop to see if it is the program or Java.
    Is is possible that Java or BlueJ are clashing with my firewall or antivirus? ZoneAlarm free & latest version, Avast free & latest version respectively? I suspect not as I use ZoneAlarm and Avast on my laptop as well as on my PC.
    BlueJ used to work fine when I had XP Home SP2 on a PATA drive, I've now upgraded to XP Pro SP2 on a SATA drive, but I can't see how a different HDD or OS could cause this problem?
    I'm going to email my Uni lecturers and see if they have any idea as well as google some more. I'll also post on the BlueJ forums, in case it is a BlueJ error and not a Java one.
    Thanks.

    Did you ever get to solve this error; I'm getting the same error.
    My environment is
    Windows XP,
    Eclipse 3.1,
    Tomcat 5.5.9
    Java version is 1.5.0_02,
    ZoneAlarm Security Suite 6.0
    Microsoft AntiSpyware
    And I have followed all the instruction provided by the tomcat for debugging for eclipse
    http://jakarta.apache.org/tomcat/faq/development.html#rd-eclipse
    But can't seemed to make it work on my home computer, but everything works fine at work.
    environment variables:
    JPDA_ADDRESS=8000
    JPDA_TRANSPORT=dt_socket
    Started the tomcat using following command:
    c:\Tomcat_HOME\bin>catalina jpda start
    When I start to debug from eclipse I get the error
    Listening for transport dt_socket at address: 8000
    ERROR: transport error 202: recv error: Software caused connection abort ["transport.c",L41]
    ERROR: transport error 202: send failed: Software caused connection abort ["transport.c",L41]
    ERROR: transport error 202: send failed: Software caused connection abort ["transport.c",L41]
    Listening for transport dt_socket at address: 8000
    Does anyone know how to solve this problem?
    Thanks

  • Develop classes in BlueJ tutorial

    Hi,
    I'm currently looking at some tutorials for bluej.. but i cant seem to work out a scenario in developing classes... yes im new to java... but i'd lov to know the answer to the following scenario:
    ===
    You are required to develop a set of classes for use in an Address List Organiser such as those found in PDA devices.
    The Software is to have the following functions.
    Add a new address item to the list.
    Remove an address item from the list.
    Print out the whole list.
    Print out a single item by supplying its position in the list.
    Search: print out all the items where the name contains a string which you specify.
    Each of the above functions will be a method belonging to a class AddressList.
    The class AddressList will also make use of another class Address.
    The Address class will contain basic address information for a single contact i.e.
    Name
    Address
    Mobile no.
    Email address.
    A useful method.
    The class String has a built in method indexOf:
    public int indexOf(String str)
    You can use it to discover if one string is contained inside another.
    So s1.indexOf(s2) will return -1 if s2 does not occur inside s1. If s2 does occur inside s1 it returns an integer defining which character the strings starts at. e.g. If s1 is "Introduction to Programming " S1.indexOf("giraffe") will return -1 and s1.indexOf("tro") will return 2.
    ===
    lov to know the answer to this... any help would be apprecaited...
    cheers,
    riz

    hi warnerja,
    its a self-study tutorial... ive been studying the
    the book of bluej.. and its an excercise, but theres
    no answer to this excercise...
    im jus highly interested in learning java, by
    comparing the question with the answers and working
    myself up...
    cheers
    riz.
    p.s. im not a studentIt doesn't matter whether this is homework for a class that you have to pass, or self-study. The principle is the same. Are you really going to learn by someone doing that exercise for you?
    As you posted from it:
    "You are required to develop a set of classes for use in an Address List Organiser such as those found in PDA devices."
    It would be best if you would follow the instructions to do that. If you can't do it, better start smaller and revisit it later.

  • Import the jar file of jfreereport to bluej

    i'm having trouble importing the jar file needed to use the jfreereport in bluej.
    as much as possible i don't want to type the SET CLASSPATH in the command window. is there a way to include the jfreereport jar file to be used in the bluej?

    You're doing privileged operations almost everywhere in this applet so you can't use the straightforward calls. At a minimum you need to put your applet in a jar, sign the jar and use AccessController.doPrivileged() to wrap the code which does the privileged operations, which is basically all of your code. In other words, you would need one to wrap your code in init(), one in start(), one in actionPerformed(), etc.

  • BlueJ command line problem

    Hi i am new to java practicing since 3 weeks now. i am using blueJ iam liking it but the problem i am facing is i can't pass command line parametres to String args through BlueJ .After right clicking on Main program (in Insert Sort) it asks for arguments when i pass the arguments that is
    4 3 2 0 1 it says :- "}" expected or ";" expected and same program if i run thru command line passing parametres it works fine. The thing is i want to use debug features of Bluej which i can't using command prompt
    please help me out

    thanks for your quick response.
    i am new to this stuff. are u telling me that
    java VectorTest one two
    will return as 0 even though there are 2
    arguments for the args array.
    if so what do i do.create a new class to accept the
    arguments and add them to the vector?
    No, if you put the command line as you describe, you should get args.length = 2, as you would expect.
    BTW - the reason your square brackets are disappearing is because the forum uses square brackets for special formatting - which is a real pain. I think the following should work:
    String nString = args;
    [ / code]
    But it doesn't exactly - the square brackets end up as angle brackets, as you can see - anyone help, please? Also, at the end of the code section, there shouldn't be spaces around the / - I just put them in to stop it acting like a real end of code section.
    Also, notice that there's no need to putnString = new String(args);
    you can use args directly.
    Robin

  • Package in bluej

    Hello!
    I�m working on this asignment for my course in computer science
    I�m having trouble compiling a class
    The teachers have created a package with a lot different
    classes, which are needed for my class (It�s about some sort of
    network of computers and I�m making the Router)
    In the instructions it says to write import se.umu.simnet.*;
    but when I compile I get: package se.umu.simnet does
    not exist
    ..the instructions also say that the already-made-classes are to be put
    in a directory called "simnet_1.0" and so I�ve done. I placed
    my Router.java there also
    ..so maybe it�s something I didn�t understand about classpaths
    or packages..I�m trying but it�s so confusing..I would be greatly
    thankful for all kinds of asisstance
    Kind Regards
    Ylva Wandel

    The class.files for this package se.umu.simnet.* were not given to me. Then you can't compile.
    Is this the package that the entire project will ultimately end up in? Or is it a bunch of utilities that the professors provide for students?
    If I had the files I could
    make
    a package on my own but this path.. se.umu.simnet
    is the domain address for the university , so it�s
    on a higher level than I can access it is supposed
    to
    be there already.It's not a matter of "being" anywhere. The package is just a naming convention. The thing that you need is a JAR with the .class files your part needs.
    I tried this and it worked in UNIX
    javac -classpath simnet.jar:. Router.javaAh! So you DO have the JAR! That's good.
    When I tried compile Router in bluej it does not
    recognize the package se.umu.simnetBecause it does not know what you told Unix above: how to find simnet.jar in the CLASSPATH. You have to look in your BlueJ docs to figure out how to do the equivalent thing in the IDE.
    These are the classes they gave me (se below, there
    in a
    directory called simnet_1.0) :
    (But there are some classes that these classes use
    that lies in se.umu.simnet)
    Maybe it has something to do with simnet.in or
    simnet.jar?
    I guess a good question is: how can I set the classpath variable in bluej? Yes, it is THE question. the BlueJ docs should help make quick work of it.
    %

  • Could someone Help please BlueJ Problem

    Ok I am a University Student, and I am at the moment learn Java, as part of my work I have to make a sun descend like the sunset
    I have wrote the method, and got it to work, at the moment though I havent gotten it to loop, and I do not know the command for looping, could someone please tell me the command so I can add it to my program.
    The program I am using to write this is called BlueJ
    Edited by: Devilslore on Oct 7, 2007 12:55 PM

    Devilslore wrote:
    I have wrote the method, and got it to work, at the moment though I havent gotten it to loop, and I do not know the command for looping, could someone please tell me the command so I can add it to my program.You should go to the Sun basic java tutorials on loops. Have a look here at the for loop tutorial:
    http://java.sun.com/docs/books/tutorial/java/nutsandbolts/for.html
    The general tutorial index is here:
    http://java.sun.com/docs/books/tutorial/java/index.html
    The program I am using to write this is called BlueJThis has nothing to do with your problem. It is a tool to help you write java, nothing more. The program you are really using is the java compiler. In fact, in your next post here, consider having a better subject header. The one you listed suggested that this was an IDE (Integrated Development Environment) problem rather than a simple java problem. By mislabeling this header, I will bet that you cut the number of folks reading your question by more than half.

  • Using Bluej to make a pethotel program

    i am new to bluej and have been given a project which i believe is over my standard but because i need it to pass my year at college i can not drop it. i recently came across this site and i thought it would be really helpful please if there is anyone out there that can help me please can you get in contact asap please. this is an outline of what the project should be.
    JAVA Project 2006/2007
    Program Brief
    The Animal Hotel
    The Animal Hotel comprises of dog kennels and a cattery where dogs and cats are looked after in palatial surroundings.
    The proprietors want a computer system which keeps track of the animals that they have in the hotel.
    The data to be stored is:-
    Owner Data: unique-owner-id, name, address, phone.
    Common Animal Data: animal-name, type-code, dob, sex, breed, weight, unique-owner-id, check-in-date, check-out-date, currently-resident-flag, days-of-stay, cost, vat, total-cost.
    (The type-code is simple 1 � dog, 2 � cat.)
    If a DOG
    Also has fields: feed-quantity, number-feeds-day
    ( All dogs get the same food here )
    If a CAT
    Has field: cat-food-brand-code
    ( Each cat is given its favourite cat food )
    The system will be menu driven and the main menu will comprise the following options:-
    Add owners
    Add animals
    Search for animal
    Search for owner
    Display current animals.
    Delete animal
    Delete owner
    Check-in animal
    Check-out animals and produce bill
    On start up the program should load the owners and pet data from file.
    On shutdown the program should write to the owners and pet data files.
    Program Specification
    The main menu options should do the following:-
    Adding owners to the system. As each owner is added a unique-owner-id is given which is simply one more than the highest one currently in use. This would allow one owner to check in more than one animal.
    Adding animals to the system. As each animal is added (The check-in and check-out date is entered but the user also enters the number of days stay so that the programmer does not have to try to calculate number of days from two dates)
    Search Animal � Showing all fields for animal � the search key is animal name.
    Search Owner � Showing all fields for owner � the search key is owner name.
    Display current animals. Showing all fields of animals who are currently checked in.
    Delete animal � only done to void errors as all animals are kept on file so that the proprietors can produce reports etc.
    Check-in animals - simply sets the in-residence flag to true by entering the unique-owner-id for all animals for that owner.
    Check-out animals and produce a bill for all the owner�s animals and sets the in-residence flag to false for all the owners animals by entering the unique-owner-id.
    The production of the owner�s bill is done by calculation the number of days stay times the room rate per night + number of days stay * food costs.
    The room rate is based on the size of the animal:-
    Up to 2kg �3.00 per night
    2kg and < 5kg �4.50
    5kg and < 10kg �5.50
    10kg and < 15kg �7.00
    15kg and < 20kg �8.50
    20kg �10.00
    The animal feed for dogs costs �1.50 per kg.
    The cat-food-codes used are:-
    1 - �0.45
    2 - �0.50
    3 - �0.65
    4 - �0.75
    5 - �0.90
    6 - �1.05
    7 - �1.20
    Data Files
    The system should use three data files � dogs.dat, cats.dat and owners.dat.
    On start up the program should read these in to arrays in memory.
    On shutdown the program should write the data from the arrays back to file.

    Think java programming, only without access to what's actually going on underneath. Learning no command line syntax, but instead painting a pretty yellow square for every Object you instantiate. Being able to right click on a pretty square and click one of any number of its methods, to see what magic happens to the variables inside it.
    IMHO, you should start off with the basics when first programming at uni, instead of hiding them away. Teach the students java, javac, and to use notepad++/emacs/vim/whatever and a command line.
    BlueJ has its place, of course. It might be useful for high school programming courses, or perhaps as a first IDE once they've learned the basics of java. Just my opinion, of course.

  • My BlueJ (PKG file) doesn't have an icon on it!

    There is no icon represent my BlueJ PKG file, but only a blank background with a window on it, how can I retrieve the image back?

    I don't know. What does that have to do with Java Programming (the topic of this forum)?

  • How to use Jasypt with BlueJ??

    Hey guys i'm trying to add the Jasypt library to my BlueJ app because thats what i use to program java. I've tried going to "preferences->library tab->add library-> <\jasypt.zip(the zip u download)>" but it doesn't work. I've also tried "tools->preferences->library tab->add library-> <C:\Program Files\BlueJ\lib\userlib\jasypt-1.5\lib\jasypt-1.5.jar>"
    each time i do this after i restart blueJ and go back to the user libraries window it says the library is loaded. but when i create a .java and "import org.jasypt*" i get a package does not exist error. can anyone help me with this? bc i def need this package for a senior comp sci project.

    Start with the iPad User's Guide:
    http://manuals.info.apple.com/en_US/ipad_user_guide.pdf
    page 35.
    Regards.

  • Rotating a square in BlueJ

    I am trying to rotate a square in BlueJ so I will get a dimond like shape.
    Can someone help me?
    Im new so all I know is in my code i need to use:
    rotate (int angle)
    what else do i need?

    You will need to spend some time with a beginner's tutorial - I recommend Sun's Java Tutorial, start with First Steps, here:
    http://java.sun.com/docs/books/tutorial/
    Once you're comfortable creating and running various kinds of programs, you should then look at the tutorial Creating a GUI with JFC/Swing, which is further down the prior page.

  • Newbie with an Urgent problem- BlueJ and Compiler related

    Hi, ok so I've downloaded the latest version of BlueJ (2.1.2) and have all of the Java components (i.e. BlueJ actually starts). However when I try to compile a program all it says is "Compiling..." in the corner. Nothing happens and when I click inside the window the message disappears with nothing being changed. Am I missing something glaringly obvious? This is my first encounter with BlueJ and the whole Java-thing. Also, time is a factor so a quick response would be INCREDIBLY appreciated. Thanks in advance.

    Hi, ok so I've downloaded the latest version of BlueJ
    (2.1.2) and have all of the Java components (i.e.
    BlueJ actually starts). However when I try to compile
    a program all it says is "Compiling..." in the
    corner. Nothing happens and when I click inside the
    window the message disappears with nothing being
    changed. Am I missing something glaringly obvious?
    This is my first encounter with BlueJ and the whole
    Java-thing. Also, time is a factor so a quick
    response would be INCREDIBLY appreciated. Thanks in
    advance.Hi,
    Well I dont Know much about the BlueJ IDE but I definately advise you to use the JCreator IDE that is perfect for a beginner and has easy to use interface. You can download the Lite Version (which is absolutely free) from:
    http://www.jcreator.com
    I had tried BlueJ but didn't like it.
    Good Wishes,
    Amanullah

  • Generate a restaurant bill using bluej. plz its urgent

    To generate a restaurant bill using blue j. take 3 categories of items like punjabi chinese and continental. take 3 dishes for each category.enter the quantity needed and display the total.

    Please drop the usage of shorthand for words, the use
    "u" and "plz" will only irritate peopleMe too. I can no longer read SMS messages from my sister....
    I assume you know a bit about OOP (object oriented programing). Think about a receipt, what do you have??
    1. The receipt.
    2. (which contains) items.
    What properties do each of these (objects) have? Well.... an item has a cost? A receipt has items. (You want to be able to add items to the receipt and maybe remove the last item added and calculate the total of all the items maybe). Carry on thinking, what else have you got. You should now be able to develop skeleton objects.
    And for reference, your post is not urgent. Although you have given a slightly better subject than help. (I know nothing about blueJ)

  • BlueJ Project - A Shop

    Hi,
    I have this project in BlueJ which I have to make for my school project. This is the final year of my school (Grade 10), and these marks count a lot (at least in my education system they do).
    I'm doing a project on a shop, and I was wondering if people out here could give me certain tips and other stuff to improve my project. I have some (not all) other people in my grade using professional help by going to a tuition & stuff, where as I'm here slogging my ass off. Obviously, their projects are turning out far better than mine. This one guy knows about his project as much as I do (which is very little), since he hasn't done much himself.
    Here's some of the stuff that I plan on including in my project:
    Inventory - The user can enter products for a shop, can view the products in the inventory, the cost, the stock, and stuff like that.
    Xerox - There's a xerox machine (colour xerox & black/white xerox).
    Employees - List of employees and their information and stuff like that.
    Billing - Creating a bill whenever a customer buys a few products and what not. There's also tax being charged.I'm not sure what more should I be including in this project.
    Someone told me about this thing called Swing, which would help for GUI and stuff. I have no clue of what it is, but I'm willing to research.
    I agree, this topic is a very vague one, but any help would be appreciated. I really want to make my project the best.

    Gausy wrote:
    Hi,
    I have this project in BlueJ which I have to make for my school project. This is the final year of my school (Grade 10), and these marks count a lot (at least in my education system they do).
    I'm doing a project on a shop, and I was wondering if people out here could give me certain tips and other stuff to improve my project. I have some (not all) other people in my grade using professional help by going to a tuition & stuff, where as I'm here slogging my ass off. Obviously, their projects are turning out far better than mine. This one guy knows about his project as much as I do (which is very little), since he hasn't done much himself.
    Here's some of the stuff that I plan on including in my project:
    Inventory - The user can enter products for a shop, can view the products in the inventory, the cost, the stock, and stuff like that.
    Xerox - There's a xerox machine (colour xerox & black/white xerox).
    Employees - List of employees and their information and stuff like that.
    Billing - Creating a bill whenever a customer buys a few products and what not. There's also tax being charged.I'm not sure what more should I be including in this project.
    Someone told me about this thing called Swing, which would help for GUI and stuff. I have no clue of what it is, but I'm willing to research.
    I agree, this topic is a very vague one,Indeed.
    but any help would be appreciated. I really want to make my project the best.You said you're willing to research. Then do so (Google, Yahoo, Altavista can help you with that). Come back here if you have specific questions. I see no question in your post.

Maybe you are looking for