Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
gotsu

Mochadoom compiling issues

Recommended Posts

Hi all,

Long time lurker but was having some issues compiling Mochadoom so decided to finally create an account.

After compiling the sources from github the jar file doesn't launch by itself. I tried using mochadoom7.bat provided with a sourceforge.net download which launched the console window which output the following:

Quote

Error: Could not find or load class i:Main

After changing the 'i/Main' portion in the batch file to 'mochadoom.Engine' the jar is once again able to launch and console outputs the following:

Quote

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: mochadoom/Engine has been compiled by a more recent version of the Java Runtime (class file version 56.0), this version of the Java Runtime only recognizes class file versions up to 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

In the output window of NetBeans IDE I have noticed the following:

Quote

Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

I have no idea how to do that and couldn't find a simple tutorial.
I used NetBeans IDE 11 with JDK 12.0.1 to compile. I have zero knowledge of any kind of code or programming so I just followed the actions described here

The precompiled version on Sourceforge would've been enough but I was having palette issues while using -width and -height parameters and -parallelrenderer didn't work, so I decided to check the github source.

Thanks all in advance and cheers.

 

Share this post


Link to post

The error sounds like your Java runtime is older than the compiler you used.

 

I'm not a Java expert so someone else may telly you something more meaningful.

 

Share this post


Link to post
Posted (edited)

TBQH, I have long ago given up on it and other people have taken it up since. You should probably contact axdoom and/or drjava for the current version. However, it looks like it's 2-3 years since they also contributed anything to it.

 

FWIW however, that latest version of Java I ever tried to compile it with (and ran) is 8 SE.

Share this post


Link to post

I'm not contributing anymore, but I still merge PRs for bug fixes and improvements. If anyone has issues, they can @ me, send a DM or open an issue.

Share this post


Link to post

Thanks to gracious help of Axdoomer, I was able to compile and run Mochadoom fine. Axdoomer made a fix on the github repository, so now anyone will be able to run the latest build of mochadoom.

Below is a small tutorial for complete noobs like me. It's relevant for Win10 x64.

I hope it gets more people interested in Mochadoom.

Spoiler
  1. Download Apache NetBeans IDE: https://netbeans.apache.org/download/
  2. Unpack the archive. I unpacked mine onto C:\netbeans.
  3. Download mochadoom-master from github. Navigate here https://github.com/AXDOOMER/mochadoom , click Clone or download and choose 'Download ZIP'
  4. Unpack the archive.
  5. Navigate to C:\netbeans\bin and run netbeans64.exe.
  6. Click File -> New Project.
  7. Choose Java with Ant and in right window Java project with existing sources. Press Next.
  8. Name your project. You don't need to change Project Folder and Build Script Name. Press Next.
  9. In Source Package Folders, press Add New and navigate to your unpacked mochadoom-master folder. Press Next.
  10. Includes and excludes can be skipped. Press Next.
  11. Now you have your new project in upper left section of NetBeans window. Select it and press Clean and Build project in the toolbar.
  12. You now have the .jar executable but do not launch it yet. Navigate to where it has been created (the folder should be shown in the console output in Netbeans).
  13. Copy the .jar file somewhere else. I copied mine onto C:\Games\mochadoom.
  14. Now you will need to create a batch file to run Mochadoom. Below are the contents of mine:

cd C:\Program Files\Java\jdk-12.0.1\bin
java -Dsun.java2d.d3d=false -cp C:\Games\mochadoom\mochadoom.jar mochadoom.Engine %* -multiply 5 -fullscreen -truecolor -novert
pause

   15. You can add/remove parameters as you please. You can find the parameter descriptions in Readme here https://sourceforge.net/projects/mochadoom/files/

   16. In my case the -iwad parameter is passed from CDL. You can add it in the batch file if you want.

   17. Save the .bat file and run it as administrator.

Enjoy your Mochadoom!

There are a few pending issues that I do not know how to solve yet:

- fullscreen doesn't work

- vertical mouse movement is present even with novert

- flats rendering artifacts

- audiolines doesn't handle sample rate correctly.

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×