Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (580)
games submitted by our members
Games in WIP (500)
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  
  stupid newbie osx question  (Read 1840 times)
0 Members and 1 Guest are viewing this topic.
Offline gleeman

Junior Newbie





« Posted 2004-05-10 08:54:35 »

i have put jinput.jar and jutils.jar in /Library/Java/Extensions and written a simple test:

import net.java.games.input.*;

public class Prova {
     public static void main(String args[]) {
           Controller[] ctrl = ControllerEnvironment.getDefaultEnvironment().getControllers();
           System.out.println(ctrl.length);
           for (int i = 0; i<ctrl.length; i++) {
                 System.out.println(ctrl.getName());
           }
     }
}

but i can't get any controller...

did i forget anything during installation ?
Offline endolf

JGO Knight


Medals: 7
Projects: 1


Current project release date: sometime in 3003


« Reply #1 - Posted 2004-05-10 11:14:47 »

Hi
 There should be a native part too, called libjinput.jnilib under osx i think, and that needs to go somewhere on the java.library.path.

HTH

Endolf

Offline gleeman

Junior Newbie





« Reply #2 - Posted 2004-05-10 11:48:41 »

Quote
Hi
 There should be a native part too, called libjinput.jnilib under osx i think, and that needs to go somewhere on the java.library.path.
Endolf


i tried to put it in the same folder with jinput.jar and jutils.jar but it doesn't work anyway...

could some kind osx user tell me where am i wrong ?

greets
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline endolf

JGO Knight


Medals: 7
Projects: 1


Current project release date: sometime in 3003


« Reply #3 - Posted 2004-05-10 12:22:58 »

Hi
 You are currently trying to install jinput into the VM from the sounds of it. I can't help you with this as I don't have an OSX box to play with. If you want to get it running on a per application bases you need to have the contents of the OSX plugin in the controller directory. Take a look at the following threads that cover issues to do with controller discovery and plugin locations.

http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=jinput;action=display;num=1073982000;start=30#31
http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=jinput;action=display;num=1083219781;start=0#1

HTH

Endolf

Offline TheBohemian

Junior Member




Java will rule them all!


« Reply #4 - Posted 2004-05-10 12:26:22 »

/Library/Java/Extensions/controller/libjinput.jnilib
/Library/Java/Extensions/controller/xyz.jar

xyz.jar is the Java part of the plugin (dont know the name).

If your game resides in some directory foo you can also put a controller subdir in foo and put the files in there. This is how it works on the other OSes.

*begging for documentation*

cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Offline gleeman

Junior Newbie





« Reply #5 - Posted 2004-05-10 16:05:33 »

Quote
/Library/Java/Extensions/controller/libjinput.jnilib
/Library/Java/Extensions/controller/xyz.jar


done...

but my program continues to see 0 controllers... i plugged an apple usb mouse for testing (those funny things with only one button) and i thought it would have worked but it don't... suggestions ?

Offline TheBohemian

Junior Member




Java will rule them all!


« Reply #6 - Posted 2004-05-11 13:10:40 »

what about the second variant? (putting controller dir in application dir) and starting it from there. it may be needed to start the app from a shell because it is necessary that System.getProperty("user.dir") points the directory where 'controller' is in.

cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Offline gleeman

Junior Newbie





« Reply #7 - Posted 2004-05-13 17:44:05 »

if i put controllers in the same dir of the applications it works correctly... thanks
Offline Swoshmn

Junior Newbie




Java games rock!


« Reply #8 - Posted 2005-03-01 23:33:44 »

k, i had a problem earlier, but I now have moved onto this.
 
I am just trying to run a quick program that will see if I have anything connected, and i get this output:
 
Scanning jar: HIDWrapper.jar
Examining file : META-INF/
Examining file : META-INF/MANIFEST.MF
Examining file : net/
Examining file : net/java/
Examining file : net/java/games/
Examining file : net/java/games/input/
Examining file : net/java/games/input/InputController.class
Examining file : net/java/games/input/InputControllerElement.class
Examining file : net/java/games/input/OSXEnvironmentPlugin.class
Found candidate class: net/java/games/input/OSXEnvironmentPlugin.class
Exception in thread "main" java.lang.NoClassDefFoundError: net/java/games/input/ControllerEnvironment
 at java.lang.ClassLoader.defineClass0(Native Method)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
 at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
 at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:282)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:282)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
 at net.java.games.util.plugins.Plugins.processJar(Plugins.java:116)
 at net.java.games.util.plugins.Plugins.scanPlugins(Plugins.java:8
 at net.java.games.util.plugins.Plugins.<init>(Plugins.java:76)
 at net.java.games.input.DefaultControllerEnvironment.scanControllersAt(Defa ultControllerEnvironment.java:199)
 at net.java.games.input.DefaultControllerEnvironment.scanControllers(Defaul tControllerEnvironment.java:189)
 at net.java.games.input.DefaultControllerEnvironment.access$000(DefaultCont rollerEnvironment.java:5
 at net.java.games.input.DefaultControllerEnvironment$1.run(DefaultControlle rEnvironment.java:109)
 at java.security.AccessController.doPrivileged(Native Method)
 at net.java.games.input.DefaultControllerEnvironment.getControllers(Default ControllerEnvironment.java:107)
 at GUI.JoystickInput.main(JoystickInput.java:45)
 
can any brilliant minds out there give me some advice or an idea of a solution?
 
thanks, Jason
Offline Jeff

JGO Coder




Got any cats?


« Reply #9 - Posted 2005-04-17 07:56:57 »

The path where yo uare putting the plug ins doesnt sound right to me, but the Mac uses a weird-arse java structure.

Can I suggest you try making a controller directory under your working directory and  putting everything there just to make sure that much is working?

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Jeff

JGO Coder




Got any cats?


« Reply #10 - Posted 2005-04-17 08:00:36 »

Quote
k, i had a problem earlier, but I now have moved onto this.

I am just trying to run a quick program that will see if I have anything connected, and i get this output:

Scanning jar: HIDWrapper.jar
Examining file : META-INF/
Examining file : META-INF/MANIFEST.MF
Examining file : net/
Examining file : net/java/
Examining file : net/java/games/
Examining file : net/java/games/input/
Examining file : net/java/games/input/InputController.class
Examining file : net/java/games/input/InputControllerElement.class
Examining file : net/java/games/input/OSXEnvironmentPlugin.class
Found candidate class: net/java/games/input/OSXEnvironmentPlugin.class
Exception in thread "main" java.lang.NoClassDefFoundError: net/java/games/input/ControllerEnvironment


Thats an odd error.  ControllerEnvironment is an abstract class and part of the jinput core code.  Whats your classpath look like? Where did you install the jinput jar?


My best geuss off the top of my head is that its not on your classpath but that you somehow launched this code off from a custom class loader and that, when the plug-ins class loader ties to find this core calss by differing to its parent, the cl;asspath classloader, the classpath classloader cant find it.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
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.

xsi3rr4x (51 views)
2014-04-15 18:08:23

BurntPizza (48 views)
2014-04-15 03:46:01

UprightPath (63 views)
2014-04-14 17:39:50

UprightPath (45 views)
2014-04-14 17:35:47

Porlus (62 views)
2014-04-14 15:48:38

tom_mai78101 (86 views)
2014-04-10 04:04:31

BurntPizza (146 views)
2014-04-08 23:06:04

tom_mai78101 (243 views)
2014-04-05 13:34:39

trollwarrior1 (202 views)
2014-04-04 12:06:45

CJLetsGame (209 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!