Results 1 to 3 of 3
  1. #1
    dpwell is offline Member
    Join Date
    Dec 2012
    Posts
    2
    Rep Power
    0

    Default Trying to create jar file from BlueJ project for eventual use as as a web applet

    Hi

    I made a simple chess game in BlueJ for a programming course a few years ago and would like to turn it into something people can try out on my website but I seem to need some help as my .jar file is not running. The game itself runs OK at the command line in Terminal, and in BlueJ itself (it won't run in NetBeans though - I get a javadoc error)

    The project has a "game" class which includes a "main" method. Using BlueJ I have saved it as a .jar When I try to run it I get a message saying "the java jar file 'game.jar' could not be launched"

    My OS is Mac OS 10.7.5 on a 2010 iMac.

    In "About BlueJ" it says "version 3.0.4 (java version 1.6.0_35)"

    I have 3 flavours of Java in my java prefs app. Two version 6 flavours from Apple and a Version 7 from Oracle. I've tried launching my .jar file with all of them and it fails each time.

    I looked at the Console output. It seems to have output the first screen, which is game instructions and then the chess board but that's as far as it gets.

    Here is most of the output. I bolded the text where there seems to be an error message (it's near the end)

    thanks in advance.
    david


    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: Welcome to Mini-Chess, a simplified version of the real thing.
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: Each player has the following pieces: a queen, a king, 2 rooks, 2 bishops, and 6 pawns.
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: Players take turns moving pieces on the board. White's pieces are at the bottom of the board
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: and are in upper case letters. Black's pieces are in lower case. White moves first.
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: The object of the game is to capture your opponent's king.
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: Pieces move as follows:
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: Queens may move any number of squares in any direction on vertical, horizontal, or diagonal rows.
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: Kings may move to any neighbouring square.
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: Rooks may move any number of squares in any direction along vertical or horizontal rows.
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: Bishops may move any number of squares in on any diagonal row.
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: Pawns may move forward one square (i.e. towards the enemy), unless there is a piece of either colour in the way.
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: Pawns may also move diagonally if they are capturing an enemy piece, but not otherwise.
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: No piece may jump over another piece, or move to a square occupied by one of it's own pieces.
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: A piece takes an enemy piece by moving to its square. The captured piece is removed from the game.
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: The columns on the board are labeled "a" through "f", from left to right.
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: The rows are numbered "1" through "6" from bottom to top.
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: So, the square in the top left-hand corner is "a6".
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: The one in the bottom right-hand corner is "f1", and so on.
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: Type the name of the square you want to move from, then the name of the square you want
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: to move to, with a space between. E.g. "a6 a4"
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: >
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: r b q k b r
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: p p p p p p
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: @ # @ # @ #
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: # @ # @ # @
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: P P P P P P
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: R B Q K B R
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: >
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: Exception in thread "main"
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: java.util.NoSuchElementException: No line found
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: at java.util.Scanner.nextLine(Scanner.java:1585)
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: at InputReader.getCoordinates(InputReader.java:51)
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: at Game.processCommand(Game.java:100)
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: at Game.playGame(Game.java:69)
    Dec 22 20:03:39 d154-5-189-50 [0x0-0x5ae5ae].com.apple.JarLauncher[78527]: at Game.main(Game.java:33)

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is online now Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,254
    Rep Power
    19

    Default Re: Trying to create jar file from BlueJ project for eventual use as as a web applet

    See the response I just posted in How to get the "output" from NetBeans into a deployable applet

    The same applies here.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    dpwell is offline Member
    Join Date
    Dec 2012
    Posts
    2
    Rep Power
    0

    Default Re: Trying to create jar file from BlueJ project for eventual use as as a web applet

    Quote Originally Posted by DarrylBurke View Post
    See the response I just posted in How to get the "output" from NetBeans into a deployable applet

    The same applies here.

    db
    thanks!

Similar Threads

  1. BlueJ project need some help with
    By Big-D in forum New To Java
    Replies: 2
    Last Post: 03-14-2012, 02:10 PM
  2. Bluej Project to exe
    By jds93 in forum New To Java
    Replies: 3
    Last Post: 11-12-2011, 01:07 PM
  3. Error Compiling Project in BlueJ
    By java1337 in forum New To Java
    Replies: 9
    Last Post: 06-17-2011, 08:04 PM
  4. Replies: 1
    Last Post: 05-04-2011, 06:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •