Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (406)
games submitted by our members
Games in WIP (293)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Compilation errors  (Read 5839 times)
0 Members and 1 Guest are viewing this topic.
Offline Gandurash

Senior Newbie





« Posted 2007-02-10 18:01:30 »

Hi...

I am rewriting and recompiling the "ControllerReadTest.java" to learn the jinput programming. but I encounter these error and I don't know how to fix it.

My OS is "Linux-Fedora Core 6" and "jinput.jar" is from jinput_combined_dist_20061029.zip.

the command I use to compile:
$ javac -classpath jinput.jar ControllerReadTest.java

the error I get:
ControllerReadTest.java:153: cannot find symbol
symbol  : variable disabled
location: class ControllerReadTest.ControllerWindow
            return disabled;
                   ^
ControllerReadTest.java:157: cannot find symbol
symbol  : variable disabled
location: class ControllerReadTest.ControllerWindow
            disabled = b;
            ^
ControllerReadTest.java:158: cannot find symbol
symbol  : variable disabled
location: class ControllerReadTest.ControllerWindow
            if(!disabled) {
                ^
Note: ControllerReadTest.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors

the source code:
....
   public boolean disabled() {
       return disabled; // >>error: line 153<<
   }

   private void setDisabled(boolean b) {
       disabled = b; // >>error: line 157<<
       if(!disabled) { // >>error: line 158<<
      this.setTitle(ca.getName());
      System.out.println(ca.getName()+" enabled");
       } else {
....

does anyone know how to fix this?
Thank you...
Offline endolf
« League of Dukes »

JGO Coder


Medals: 4
Projects: 1


Current project release date: sometime in 3003


« Reply #1 - Posted 2007-02-11 10:55:30 »

Looks like you've not defined 'disabled' anywhere.

Offline Gandurash

Senior Newbie





« Reply #2 - Posted 2007-02-12 04:07:49 »

Dear endolf,

thanks for your advice, it helps.

when I compile the exact same code as the source code of ControllerReadTest (from: https://jinput.dev.java.net/source/browse/jinput/coreAPI/src/java/net/java/games/input/test/ControllerReadTest.java) with:
1  
$ javac -Xlint:unchecked -classpath jinput.jar ControllerReadTest.java
, I got these warning messages:
1  
2  
3  
4  
5  
6  
7  
ControllerReadTest.java:182: warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.List
            axisList.add(p2);
                        ^
ControllerReadTest.java:255: warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.List
        controllers.add(new ControllerWindow(this, c));
                       ^
2 warnings

although this is only warning messages, I want to know the meaning of these warning. Please tell me the meaning of these?

when I ran the program with:
1  
$ java -cp jinput.jar ControllerReadTest
, I got the following error messages:
1  
2  
3  
4  
5  
6  
7  
8  
Exception in thread "main" java.lang.NoClassDefFoundError: ControllerReadTest
   at gnu.java.lang.MainThread.run(libgcj.so.7rh)
Caused by: java.lang.ClassNotFoundException: ControllerReadTest not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:jinput.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
   at java.net.URLClassLoader.findClass(libgcj.so.7rh)
   at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.7rh)
   at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
   at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
   at gnu.java.lang.MainThread.run(libgcj.so.7rh)

as I look at the source code of ControllerReadTest.java, I can see the main method at the last part of the code. Please explain me how to properly compile and run the ControllerReadTest code?

Thank you.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline endolf
« League of Dukes »

JGO Coder


Medals: 4
Projects: 1


Current project release date: sometime in 3003


« Reply #3 - Posted 2007-02-12 08:46:29 »

The warnings are because jinput works with java 1.4 and you are using java 1.5 or newer which has generics in that give you typed lists, the compiler warns you if you are compiling code with a target greater than 1.4 if you use unon typed lists.

you have added the jinput jar to the classpath, but not the file you have compiled. You should have a directory structure somewhere that matches the package structure of the class, and in there will be a .class, add the top directory to your classpath and it will work.

1  
java -cp jinput.jar;<directory I compiled it all too> net.java.games.input.test.ControllerReadTest


Endolf

Offline Gandurash

Senior Newbie





« Reply #4 - Posted 2007-02-12 09:09:29 »

Dear endolf,

Thank you for your advice, you are my savior.  Grin
It is working fine now.

about the warnings I mentioned. Could you be more specific on which line of source code is for java 1.4. and if you don't mind, could you provide me with the solution in order to solve the warnings.

Thank you.
Offline endolf
« League of Dukes »

JGO Coder


Medals: 4
Projects: 1


Current project release date: sometime in 3003


« Reply #5 - Posted 2007-02-12 13:05:50 »

http://www.onjava.com/pub/a/onjava/excerpt/javaian5_chap04/index.html

About 1/3 of the way down, the heading 'Raw types and unchecked warnings' should cover it. These are general Java questions not JInput related ones, so you could ask them on the Newbie forums.

Endolf

Offline Gandurash

Senior Newbie





« Reply #6 - Posted 2007-02-12 23:11:44 »

Dear endolf,

I got it... thanks for everything.  Cheesy

See you later....
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Try the Free Demo of Revenge of the Titans

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (76 views)
2013-05-17 21:29:12

alaslipknot (89 views)
2013-05-16 21:24:48

gouessej (118 views)
2013-05-16 00:53:38

gouessej (113 views)
2013-05-16 00:17:58

theagentd (125 views)
2013-05-15 15:01:13

theagentd (112 views)
2013-05-15 15:00:54

StreetDoggy (156 views)
2013-05-14 15:56:26

kutucuk (178 views)
2013-05-12 17:10:36

kutucuk (178 views)
2013-05-12 15:36:09

UnluckyDevil (186 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!
Page created in 0.172 seconds with 21 queries.