Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Contributor
Posts: 8
Registered: ‎03-31-2010
My Device: 9700 BOLD

Trying to get this Getris Source code to compile... (TETRIS CLONE)

Source Code is here..

http://jiri.patera.name/xhtml/uk/projects-getris.html

 

With all java files added to my workspace.

 

I've tried compiling as is which gives warnings below.

 

C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\rapc.exe -quiet codename=TETRIS2 TETRIS2.rapc warnkey=0x52424200;0x52525400;0x52435200  import=..\lib\net_rim_api.jar "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\gui\InstructionsForm.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\GetrisMIDlet.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\gui\AboutForm.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\gui\GameCanvas.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\gui\MainList.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\gui\NextLevelCanvas.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\gui\SettingsForm.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\gui\SplashScreenCanvas.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\gui\TopTableForm.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\gui\TopTablesCanvas.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\gui\WinningAlert.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\interfaces\CanvasObject.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\interfaces\RMSStorable.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\logic\BlockProvider.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\logic\GameSettings.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\logic\Level.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\objects\Block.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\objects\BlockStock.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\objects\LevelQuota.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\objects\NextBlockBox.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\objects\NextLevelScreen.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\objects\Square.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\objects\Statistics.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\objects\TopTable.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\util\Colors.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\util\GetrisRandom.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\util\GetrisThread.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\util\I18n.java" "C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\util\Log.java"
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\logic\BlockProvider.java:160: Warning!: member data 'int STANDARD_BLOCKS_COUNT' not required in class: getris.logic.BlockProvider
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\logic\GameSettings.java:541: Warning!: method 'getris.logic.GameSettings.removeFromRMS()' not invoked.
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\logic\GameSettings.java:671: Warning!: method 'getris.logic.GameSettings.getAllRMSStoragesNames()' not invoked.
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\logic\GameSettings.java:690: Warning!: method 'getris.logic.GameSettings.removeAllRMSStorages()' not invoked.
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\logic\GameSettings.java:731: Warning!: method 'getris.logic.GameSettings.isStoredInRMS()' not invoked.
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\logic\GameSettings.java:799: Warning!: method 'getris.logic.GameSettings.resetAllTopTables()' not invoked.
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\objects\BlockStock.java:191: Warning!: method 'getris.objects.BlockStock.getRowsCount()' not invoked.
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\objects\NextLevelScreen.java:79: Warning!: member data 'boolean isVisible' not required in class: getris.objects.NextLevelScreen
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\objects\NextLevelScreen.java:79: Warning!: member data 'int x' not required in class: getris.objects.NextLevelScreen
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\objects\NextLevelScreen.java:79: Warning!: member data 'int y' not required in class: getris.objects.NextLevelScreen
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\objects\NextLevelScreen.java:90: Warning!: method 'getris.objects.NextLevelScreen.isVisible()' not invoked.
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\objects\NextLevelScreen.java:168: Warning!: method 'getris.objects.NextLevelScreen.hide(Graphics)' not invoked.
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\objects\Square.java:53: Warning!: member data 'boolean isVisible' not required in class: getris.objects.Square
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\objects\Square.java:264: Warning!: method 'getris.objects.Square.isVisible()' not invoked.
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\objects\Statistics.java:301: Warning!: method 'getris.objects.Statistics.getTopScore()' not invoked.
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\objects\Statistics.java:404: Warning!: method 'getris.objects.Statistics.reset()' not invoked.
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\objects\Statistics.java:472: Warning!: method 'getris.objects.Statistics.getHeight()' not invoked.
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\objects\TopTable.java:361: Warning!: method 'getris.objects.TopTable.removeFromRMS()' not invoked.
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\util\Log.java:32: Warning!: member data 'int levelConsole' not required in class: getris.util.Log
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\util\Log.java:81: Warning!: method 'getris.util.Log.setLevel(int)' not invoked.
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\util\Log.java:94: Warning!: method 'getris.util.Log.info(String)' not invoked.
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\util\Log.java:111: Warning!: method 'getris.util.Log.debug(String)' not invoked.
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\util\Log.java:128: Warning!: method 'getris.util.Log.warning(String)' not invoked.
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\util\Log.java:145: Warning!: method 'getris.util.Log.error(String)' not invoked.
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\util\Log.java:159: Warning!: method 'getris.util.Log.getDateStr()' not invoked.
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\util\Log.java:211: Warning!: method 'getris.util.Log.getLevelStr(int)' not invoked.
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\objects\LevelQuota.java:437: Warning!: local variable(s) { i } initialized but not used in: getris.objects.LevelQuota.updateInRMS()
Warning!: No definition found for exported static routine: .main(String[])
Build complete.

(it has no "public static void main" in the source)

 

and with another java file of my own labelled helloworld.java


package getris;
import net.rim.device.api.ui.*;

 

class HelloWorld extends UiApplication {
    public static void main(String[] args) {
        HelloWorld app = new HelloWorld();
        app.enterEventDispatcher();
    }  
    public HelloWorld() {
        pushScreen(new GetrisMIDlet());
    }
}

 (so now it has "public static void main")

which when compiled only shows......
C:\Program Files\Research In Motion\BlackBerry JDE 5.0.0\bin\getris\helloworld.java:18: pushScreen(net.rim.device.api.ui.Screen) in net.rim.device.api.ui.UiApplication cannot be applied to (getris.GetrisMIDlet)
        pushScreen(new GetrisMIDlet());
        ^
1 error
Error!: Error: java compiler failed: javac -source 1.3 -target 1.3 -g -O -d C:\DOCUME~1\User\LOCALS~1\Temp\rapc_1ac50d82.dir -bootclassp ...
Error while building project

 

I'm still a newbie so its no doubt my fault somewhere!! but where?


Please someone help???

 

New Contributor
Posts: 8
Registered: ‎03-31-2010
My Device: 9700 BOLD

Re: Trying to get this Getris Source code to compile... (TETRIS CLONE)

Do i need more than the Java files added to get the program to run? perhaps thats why? I have only added the src directory of java files to the blackberry jde workspace thus far.

Developer
Developer
Posts: 1,123
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook

Re: Trying to get this Getris Source code to compile... (TETRIS CLONE)

The warnings just mean that those variables and methods have not been used or called. The error with main just means you have not defines a main method in that project. The error with pushScreen is because you are using a Midlet which does not use the RIM classes but the generic Midlet Screen class.