Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
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 6154 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

JGO Coder


Medals: 7


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

JGO Coder


Medals: 7


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

JGO Coder


Medals: 7


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.

 

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

The first screenshot will be displayed as a thumbnail.

Riven (11 views)
2014-07-29 18:09:19

Riven (8 views)
2014-07-29 18:08:52

Dwinin (9 views)
2014-07-29 10:59:34

E.R. Fleming (25 views)
2014-07-29 03:07:13

E.R. Fleming (10 views)
2014-07-29 03:06:25

pw (39 views)
2014-07-24 01:59:36

Riven (39 views)
2014-07-23 21:16:32

Riven (27 views)
2014-07-23 21:07:15

Riven (28 views)
2014-07-23 20:56:16

ctomni231 (59 views)
2014-07-18 06:55:21
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
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!