# Can anyone help me with Java?

**URL:** <https://boards.straightdope.com/t/can-anyone-help-me-with-java/338817>\
**Category:** Factual Questions\
**Created:** [January 6, 2006, 11:44pm UTC](https://boards.straightdope.com/t/can-anyone-help-me-with-java/338817 "2006-01-06T23:44:56Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Standup\_Karmic](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@Standup\_Karmic](https://boards.straightdope.com/u/Standup_Karmic)\
**Post date:** [January 6, 2006, 11:44pm UTC](https://boards.straightdope.com/t/can-anyone-help-me-with-java/338817/1 "2006-01-06T23:44:56Z")

</div>

I’m thinking this probably isn’t difficult, I just don’t know how to do it.

I want to add a text adventure engine onto my website. The engine is [Cycon Online Gaming Engine](http://cogengine.sourceforge.net/). I don’t know anything about Java, other than it’s a programming language.

There’s a download page. I’ve downloaded the .jar file (I’m not quite sure I understand what that is, mind you). I’ve downloaded the data file. But I can’t download the Engine files (which are all .class files, I think) as they’re not available compiled.

Do I not need those additional files if have the .jar file? I’ve put the .jar file and the data files onto my site at [hhop.godsandartists.com](http://hhop.godsandartists.com), along with an index file that includes the applet. It won’t work.

Assuming that the software even works (it seems to on his site), what have I done wrong? Am I just missing the .class files? How do I compile them from the available source files, if that’s what I have to do?

Oh, please help. I’m annoyed.

---

<div class="post-metadata">

**Author:** ![ThisSpaceForRent](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/thisspaceforrent/32/345_2.png) [@ThisSpaceForRent](https://boards.straightdope.com/u/ThisSpaceForRent)\
**Post date:** [January 6, 2006, 11:48pm UTC](https://boards.straightdope.com/t/can-anyone-help-me-with-java/338817/2 "2006-01-06T23:48:39Z")

</div>

try this…

[Java Rutime Environment (JRE)](http://java.com/en/download/help/5000010400.xml)

it is the latest jave VM (run time) version.  
Hope this helps 🙂

TSFR

---

<div class="post-metadata">

**Author:** ![Rysto](https://avatars.discourse-cdn.com/v4/letter/r/ecccb3/32.png) [@Rysto](https://boards.straightdope.com/u/Rysto)\
**Post date:** [January 6, 2006, 11:55pm UTC](https://boards.straightdope.com/t/can-anyone-help-me-with-java/338817/3 "2006-01-06T23:55:21Z")

</div>

He shouldn’t need the JRE if it’s an applet.

You don’t need to get the class file, it’s in the jar file(jar files are essentially a bunch of class files in a zip file) Try adding the attribute codebase="." to the applet tag.

---

<div class="post-metadata">

**Author:** ![Standup\_Karmic](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@Standup\_Karmic](https://boards.straightdope.com/u/Standup_Karmic)\
**Post date:** [January 7, 2006, 12:03am UTC](https://boards.straightdope.com/t/can-anyone-help-me-with-java/338817/4 "2006-01-07T00:03:02Z")

</div>

I added that tag. This is the error I get:

DatabaseURL : ([http://hhop.godsandartists.com/CyconOdyssey.dat](http://hhop.godsandartists.com/CyconOdyssey.dat))

java.lang.NoClassDefFoundError: GameInfoOBJ  
at CogEngine.init(CogEngine.java:151)  
at sun.applet.AppletPanel.run(Unknown Source)  
at java.lang.Thread.run(Unknown Source)

Any thoughts?

---

<div class="post-metadata">

**Author:** ![DarrenS](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@DarrenS](https://boards.straightdope.com/u/DarrenS)\
**Post date:** [January 7, 2006, 12:34am UTC](https://boards.straightdope.com/t/can-anyone-help-me-with-java/338817/5 "2006-01-07T00:34:51Z")

</div>

First thing I would suggest you do is _temporarily_ rename the jar file to “.zip”. If it was Foo.jar, rename it to Foo.zip.

Windows XP (assuming that’s what you’re using) will then happily open it and show you the contents. If not, use your favorite Zip utility to browse it.

Somewhere within that jar file should be GameInfoOBJ.class. Do you see it?

---

<div class="post-metadata">

**Author:** ![DarrenS](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@DarrenS](https://boards.straightdope.com/u/DarrenS)\
**Post date:** [January 7, 2006, 12:37am UTC](https://boards.straightdope.com/t/can-anyone-help-me-with-java/338817/6 "2006-01-07T00:37:57Z")

</div>

BTW, to make the applet see the jarfile you need to add the ‘archive=’ attribute to the applet tag:

[http://java.sun.com/j2se/1.5.0/docs/guide/jar/jarGuide.html](http://java.sun.com/j2se/1.5.0/docs/guide/jar/jarGuide.html)

> [@](#):
>
> Changing the APPLET tag in your HTML page to accomodate a Jar file is simple. The Jar file on the server is identified by the ARCHIVE parameter, where the directory location of the jar file should be relative to the location of the html page:
> 
> ```auto
> 
> <applet code=Animator.class 
> archive="jars/animator.jar"
> width=460 height=160>
> <param name=foo value="bar">
> </applet>
> 
> ```

---

<div class="post-metadata">

**Author:** ![Standup\_Karmic](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@Standup\_Karmic](https://boards.straightdope.com/u/Standup_Karmic)\
**Post date:** [January 8, 2006, 5:31pm UTC](https://boards.straightdope.com/t/can-anyone-help-me-with-java/338817/7 "2006-01-08T17:31:20Z")

</div>

**DarrenS** , I looked into the .jar file and I didn’t find a GameInfoOBJ file. That’s going to be a key problem, isn’t it. Since that is the file that the error message said it was looking for?

Also, I have added the archive attribute.

---

<div class="post-metadata">

**Author:** ![Standup\_Karmic](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@Standup\_Karmic](https://boards.straightdope.com/u/Standup_Karmic)\
**Post date:** [January 8, 2006, 5:40pm UTC](https://boards.straightdope.com/t/can-anyone-help-me-with-java/338817/8 "2006-01-08T17:40:22Z")

</div>

**DarrenS** , I looked into the .jar file and I didn’t find a GameInfoOBJ file. That’s going to be a key problem, isn’t it. Since that is the file that the error message said it was looking for?

Also, I have added the archive attribute.

---

<div class="post-metadata">

**Author:** ![DarrenS](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@DarrenS](https://boards.straightdope.com/u/DarrenS)\
**Post date:** [January 8, 2006, 5:57pm UTC](https://boards.straightdope.com/t/can-anyone-help-me-with-java/338817/9 "2006-01-08T17:57:31Z")

</div>

**Standup Karmic** - which file are you downloading?

When I download the stable release - [http://prdownloads.sourceforge.net/cogengine/CogEngine-1.0-classes.zip](http://prdownloads.sourceforge.net/cogengine/CogEngine-1.0-classes.zip) - from the link you gave, and open up the zip file, I do indeed see GameInfoObj.class.

Try downloading this file too, and unzipping it into the same directory as your jar file.

---

<div class="post-metadata">

**Author:** ![DarrenS](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@DarrenS](https://boards.straightdope.com/u/DarrenS)\
**Post date:** [January 8, 2006, 6:00pm UTC](https://boards.straightdope.com/t/can-anyone-help-me-with-java/338817/10 "2006-01-08T18:00:07Z")

</div>

Also, check out the installation instructions in the README for the file I mentioned above:

> [@](#):
>
> ## Quick Installation Instructions
> 
> ```
> There is no automated install process available for The Cog
> 
> ```
> 
> Engine, so a manual install is necessary. The engine itself is merely a  
> series of java class files, you will need some sort of game data file in  
> order to actually try out the engine. “The Cycon Odyssey” is provided for  
> this purpose. The Cycon Odyssey is currently an incomplete game, but there  
> is enough in place for a new user to get a feel for how the engine works.  
> e
> 
> 1. Download the class files for the Cog Engine (You may optionally  
> download the source files, and compile them yourself, though this is not  
> stricly necessary)
> 
> 2. Download the sample game files for the Cycon Odyssey. You will probably  
> need the Images archive as well.
> 
> 3. Extract downloaded files into the directory. The “Images” archive  
> should be a subdirectory of this directory.
> 
> 4. Load the “CogEngine.html” file into your favorite web browser, or the  
> Java Appletviewer.  
> Example (Under Linux):
> 
> tar xvzf CogEngine-0.95-classes.tar.gz  
> tar xvzf CyconOdyssey-0.95-data.tar.gz  
> tar xvzf CyconOdyssey-0.95-images.tar.gz  
> cp CogEngine-0.95/\* CyconOdyssey-0.95  
> cd CyconOdyssey-0.95  
> appletviewer CogEngine.html

---

<div class="post-metadata">

**Author:** ![Standup\_Karmic](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@Standup\_Karmic](https://boards.straightdope.com/u/Standup_Karmic)\
**Post date:** [January 8, 2006, 9:23pm UTC](https://boards.straightdope.com/t/can-anyone-help-me-with-java/338817/11 "2006-01-08T21:23:16Z")

</div>

I suppose I’m getting all messed up because of the different versions and different archives.

I’ve downloaded the Cycon Odyssey 0.98.2 files and the readme says that it is for development version 1.1.6 (rather than the “stable” version). So that’s why I downloaded the .jar file for 1.1.6. I looked into the .jar file and didn’t see the GameInfoOBJ.class file. Odyssey 0.98.1 says its for ver 1.1.3, which doesn’t appear to be available.

Also, the instructions for installation that you put up say to point the browser to the CogEngine.html file. But there’s no such file in the CogEngine-1.0-classes.tgz file. I guess that means I have to create it, but I’m not sure how to write it. I stole the source for his games page and it points to the .jar file on his site, which is why I’ve tried to set mine up in a similar way.

I could try the 0.98.2 file with the 1.0 engine, but I’m not sure how to write the code to insert the applet if there’s no .jar file.

Sorry if this is getting a bit bunged up. I was hoping it would be quicker and easier than this so as not to require too much time.

---

<div class="post-metadata">

**Author:** ![DarrenS](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@DarrenS](https://boards.straightdope.com/u/DarrenS)\
**Post date:** [January 8, 2006, 11:08pm UTC](https://boards.straightdope.com/t/can-anyone-help-me-with-java/338817/12 "2006-01-08T23:08:12Z")

</div>

As usual with open source stuff, it assumes you’re a developer; it’s a lot more hands on than you might be used to.

I dug a bit deeper, and even got as far as creating an HTML page with a vald applet tag, that loads the sample database. However, the applet is then throwing an exception. I think it’s because, looking at the source, it doesn’t seem to like the format of the CyconOdyssey.dat file - it’s trying to import it into a Java object and getting a “ClassCastException”. I don’t have time to dig any further right now, but I’ll paste the HTML I came up with in case you want to try. Also, you might want to try emailing the author on SourceForge.

```auto

<applet codebase="." code="CogEngine.class" archive="CogEngine-1.1.6-Jython_Applet.jar" width="648" height="480" align="center">
    <param name="DatabaseFilename" value="CyconOdyssey.dat">
    <hr>
    If you were using a Java-enabled browser you would see the applet.
    <hr>
    </applet>

```

---

<div class="post-metadata">

**Author:** ![Standup\_Karmic](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@Standup\_Karmic](https://boards.straightdope.com/u/Standup_Karmic)\
**Post date:** [January 8, 2006, 11:46pm UTC](https://boards.straightdope.com/t/can-anyone-help-me-with-java/338817/13 "2006-01-08T23:46:26Z")

</div>

Thanks very much for that.

I’ve e-mailed the author and he has said he hasn’t worked on it for a long time, but will try to recall how it all works and get back to me. Hopefully that will yield positive results. Thanks again!
