Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (577)
games submitted by our members
Games in WIP (498)
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  
  [SOLVED] Slick2D and JDeveloper 11G  (Read 2886 times)
0 Members and 1 Guest are viewing this topic.
Offline civicdude95

Senior Newbie


Medals: 1



« Posted 2011-08-13 23:57:52 »

Hey guys I'm having a tough time with this one and have been unable to find much through Googling and researching, so I thought I would just ask you guys. I've been using NetBeans to develop my games in (using Slick2D) and I'm trying to switch over to JDeveloper (because that's the IDE we use at work) and I can't seem to get even a test game up and running.

I have no problems setting up the Slick library and linking the classpath to it (in Project Properties). I am even able to set the runtime Java Options to (in my case) -Djava.library.path="C:\Program Files (x86)\Java\slick", just like it is in my NetBeans projects. However, every time I try to run an application (Slick application that is, regular ones work just fine) I get a windowed error message that says "Could not find the main class: Files. Program will exit" with "Java Virtual Machine Launcher" as the window's title.

I'm thinking that it has something to do with an incorrectly typed path somewhere (the idea being that the "Files" from the error is part of the \Program Files (x86)\Java path, but I've checked all my paths in the project properties that have "Files" in it and they all are fine.

Has anyone else tried using JDev with Slick2D and been successful and if so, do you have any ideas on how to fix my problem?

Thanks guys.

Read about simple game development.
Download your free copy of Prospectus
Offline ra4king

JGO Kernel


Medals: 322
Projects: 2
Exp: 4 years


I'm the King!


« Reply #1 - Posted 2011-08-14 00:13:57 »

I've never used JDeveloper but the errors sounds like it can't find the class that you are specifying as the main class, here being Files.class. Why would that be part of the java.library.path? -Djava.library.path is used to specify the folder containing native libraries. Then you need to use -classpath or -cp to specify jar files.

1  
java -Djava.library.path="path/to/natives/folder" -cp "path/to/jars" MainClass


Also as a rule of thumb, never save any libs in the java directory. The standard way is to make a folder called "lib" under your project folder and put all your libraries there.

Offline civicdude95

Senior Newbie


Medals: 1



« Reply #2 - Posted 2011-08-14 00:21:28 »

Well that's the kicker, I don't have any classes named "Files" and my main class is called "Game". That and the fact that the error window that pops up is titled "Java Virtual Machine Launcher" makes me think it is something in my JVM Options (Located under Project Properties > Run/Debug/Profile).

And as far as the -Djava.library.path stuff goes, I was told to do that from the Documentation on the coke and code site (for NetBeans) and so that's why I was using it for JDev, because I figured that type of thing would be the same across the different IDE's.

Read about simple game development.
Download your free copy of Prospectus
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ra4king

JGO Kernel


Medals: 322
Projects: 2
Exp: 4 years


I'm the King!


« Reply #3 - Posted 2011-08-14 00:36:37 »

Ah right this means that it is somehow ignoring the double quotations, which is used to include all whitespaces as part of the argument. What is your entire command?

Online loom_weaver

JGO Coder


Medals: 17



« Reply #4 - Posted 2011-08-14 00:37:06 »

-Djava.library.path="C:\Program Files (x86)\Java\slick"

...

"Could not find the main class: Files. Program will exit"

I bet the "Files" is from the Program Files specification.  Try the usual quoting, escaping, etc.
Offline ra4king

JGO Kernel


Medals: 322
Projects: 2
Exp: 4 years


I'm the King!


« Reply #5 - Posted 2011-08-14 00:45:20 »

-Djava.library.path="C:\Program Files (x86)\Java\slick"

...

"Could not find the main class: Files. Program will exit"

I bet the "Files" is from the Program Files specification.  Try the usual quoting, escaping, etc.

I'm thinking that it has something to do with an incorrectly typed path somewhere (the idea being that the "Files" from the error is part of the \Program Files (x86)\Java path, but I've checked all my paths in the project properties that have "Files" in it and they all are fine.

Offline civicdude95

Senior Newbie


Medals: 1



« Reply #6 - Posted 2011-08-14 03:37:07 »

I'm pretty sure it's in that -Djava.library.path also, but I'm a little slow today, what do you mean by the "usual quoting, escaping, etc."?

Read about simple game development.
Download your free copy of Prospectus
Online loom_weaver

JGO Coder


Medals: 17



« Reply #7 - Posted 2011-08-14 04:10:48 »

I'm pretty sure it's in that -Djava.library.path also, but I'm a little slow today, what do you mean by the "usual quoting, escaping, etc."?

From what you described it is almost certain that the problem has something to do with the way that JDeveloper handles the vm parameter in launching the Java application.

It's not properly handling the path with the space in it.  To try and fix this, try to determine the exact call to Java (as ra4king suggested).  From here you can try different combinations of quoting the vm parameter, using a backslash in front of the space, or move the slick libraries to a location on your filesystem that doesn't have a space in it.
Offline Mads

JGO Ninja


Medals: 24
Projects: 3


One for all!


« Reply #8 - Posted 2011-08-15 10:51:05 »

Sometimes referencing paths that have whitespace in them are causing problems. You should refer the classpath to a relative destination instead. That way you will also have an easier time when desploying, because it can be ran with the whole installation inside a folder, instead of spreading it out throughout the computer Smiley
Try doing something like "lib/" and keep your libraries and native stuff in there.

Offline civicdude95

Senior Newbie


Medals: 1



« Reply #9 - Posted 2011-08-15 21:27:54 »

Ok guys I have finally got it working  Cool

I tried a test game at work with the latest Slick download and just placing the .dll's at my project root level and was able to get a Hello World game running (go figure). So what I ended up doing was downloading the latest Slick on my laptop (computer I develop on), placed the .dll's at \(project root)\lib (which I created, thanks for the suggestion ra4king), and under my Java Options I put

-Djava.library.path=lib

So far it's working just like it should, and now I will know to first check the latest version of Slick before changing IDE's.

Thanks guys for helping me out with this one (it was incredibly frustrating for awhile)!

Read about simple game development.
Download your free copy of Prospectus
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ra4king

JGO Kernel


Medals: 322
Projects: 2
Exp: 4 years


I'm the King!


« Reply #10 - Posted 2011-08-16 04:48:29 »

Glad to help. Cheesy

Offline civicdude95

Senior Newbie


Medals: 1



« Reply #11 - Posted 2011-08-16 19:57:39 »

Hey guys I just wanted to let you know that I wrote a blog post/tutorial on how to set up a basic game with Slick2D and JDeveloper. Check it out here and let me know what you think.

Read about simple game development.
Download your free copy of Prospectus
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 (18 views)
2014-04-15 18:08:23

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

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

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

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

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

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

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

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

CJLetsGame (187 views)
2014-04-01 02:16:10
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

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