PAiN Java based Mudlib

I stumbled upon this project found at http://pain.sourceforge.net/index.html that i though looked really cool. I can not get it to compile and i was woundering if anyone could lend a hand. I am relatively new to java. Here is the e-mail that i sent to project owner's e-mail with no avail.

"

Hello Mike,

A friend and myself have downloaded your PAiN Java Mud Codebase to start a mud of our own. However we have run into an issue and I was wondering if you could give us a hand?

To start we have a PC that we are using as a 'server'. It has a fresh install of Windows XP Professional with all updates. I downloaded and installed J2EE 5 SDK. When we go to run the Build_all.bat we received the following error message

Buildfile: build.xml

init:

paindb:

[echo] compiling..

[javac] Compiling 1 source file to C:\PainMud\db\classes

codebase:

[echo] compiling..

mudlib:

[echo] compiling..

[javac] Compiling 168 source files to C:\PainMud\mudlibs\tinylib\classes

[javac] C:\PainMud\mudlibs\tinylib\src\net\sourceforge\pain\tinylib\logic\fn

\LogoFn.java:14: reference to Console is ambiguous, both class java.io.Console i

n java.io and class net.sourceforge.pain.tinylib.Console in net.sourceforge.pain

.tinylib match

[javac]public static void showLogo(Console console) {

[javac] ^

[javac] 1 error

I have gone to the C:\PainMud\mudlibs\tinylib\src\net\sourceforge\pain\tinylib\logic\fn

\LogoFn.java file and found the the import statements seem to be the problem. The import net.sourceforge.pain.util.* is not found. I did some research and found that this folder is located in the C:\PainMud\db\src\net\sourceforge\pain\util but the correct file is located in C:\PainMud\mudlibs\tinylib\src\net\sourceforge\pain\

Do you know any way to correct this? any suggestions?

"

The same question is posed to the forum. Feel free you visit the website i post above to download the source code. I will also take suggestion on alternative but similar projects

[2106 byte] By [Nexeha] at [2007-11-27 9:58:26]
# 1

Its one reason why you should not import packages using "*"

delete the java.io.* import statement. Then recompile. For each error it gives you need to add an appropriate import statement

e.g.

import java.io.InputStream;

import java.io.File;

etc.

Just make sure that you import the Console class from the sourceforge package. This fixes the code to work with jdk1.6 however you may have other problems in the code base.

You are actually compiling the code using java 1.6. In 1.6 sun added a class called Console to the java.io package. So you can either do what I suggested above (fix the code to compile against jdk1.6) or install jdk1.5 (which does not have this class) and compile using that.

matfud

matfuda at 2007-7-13 0:29:06 > top of Java-index,Java Essentials,Java Programming...
# 2

Thank you so much I will try that RIGHT NOW, I will award points on my return. Thank you so much matfud!

Am I going to have to do this in all files or just the problematic one?

i think that this will fix one problem but I think that other import statements are incorrect as well... heres some of the errors before i make changes:

C:\PainMud\mudlibs\tinylib\src\net\sourceforge\pain\tinylib\logic\fn\LogoFn.java:6: package net.sourceforge.pain.util does not exist

import net.sourceforge.pain.util.*;

^

C:\PainMud\mudlibs\tinylib\src\net\sourceforge\pain\tinylib\logic\fn\LogoFn.java:7: cannot find symbol

symbol : class Console

location: package net.sourceforge.pain.tinylib

import net.sourceforge.pain.tinylib.Console;

^

C:\PainMud\mudlibs\tinylib\src\net\sourceforge\pain\tinylib\logic\fn\LogoFn.java:22: cannot find symbol

symbol : variable Log

location: class net.sourceforge.pain.tinylib.logic.fn.LogoFn

Log.error(e.getMessage(), e);

^

C:\PainMud\mudlibs\tinylib\src\net\sourceforge\pain\tinylib\logic\fn\LogoFn.java:28: cannot find symbol

symbol : variable MessageOutFn

location: class net.sourceforge.pain.tinylib.logic.fn.LogoFn

MessageOutFn.out(console, currentLogo);

^

C:\PainMud\mudlibs\tinylib\src\net\sourceforge\pain\tinylib\logic\fn\LogoFn.java:32: cannot find symbol

symbol : variable Mudlib

location: class net.sourceforge.pain.tinylib.logic.fn.LogoFn

FileReader reader = new FileReader(Mudlib.CONFIG_DIR + "/logo");

^

C:\PainMud\mudlibs\tinylib\src\net\sourceforge\pain\tinylib\logic\fn\LogoFn.java:54: cannot find symbol

symbol : variable Codebase

location: class net.sourceforge.pain.tinylib.logic.fn.LogoFn

return (template.substring(0, versionStart) + Codebase.CODEBASE_VERSION + template.substring(versionEnd));

Would you be will to make corrections and e-mail them to me?

Nexeha at 2007-7-13 0:29:06 > top of Java-index,Java Essentials,Java Programming...
# 3

The first of those errors appears to be because you do not have a jar file in the correct place. All of the jar files you need MUST be in the classpath for the compiler (javac). Your .bat script should incude the correct jar files.

jar files are just zip files. You can use something like WinZip to look inside them. This can enable you to find the jar file that contains the package that javac is complaining about. When you find the jar that contains the required class you should add it to the classpath used by the compiler (modify the .bat script or copy the correct file to a directory that the script uses).

matfud

matfuda at 2007-7-13 0:29:06 > top of Java-index,Java Essentials,Java Programming...
# 4

Your best bet is to download jdk1.5 or jdk1.4 and use that to compile the code.

The advise I have given previously relates to converting the code so that it can run on java 1.6. This could be a large(ish) task. Get one of the earlier versions of java and you should have few problems. If you have problems using earlier versions to compile this software then it is likely there are issues in the build system used by the project. If so you need ti fix them or get the person who wrote the code/buildsystem to fix them.

matfud

matfuda at 2007-7-13 0:29:06 > top of Java-index,Java Essentials,Java Programming...