Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java 6/7 Compatibility #28

Open
lousakura opened this issue Feb 21, 2023 · 42 comments
Open

Java 6/7 Compatibility #28

lousakura opened this issue Feb 21, 2023 · 42 comments

Comments

@lousakura
Copy link

Hello!
I was wondering if it would be possible to add compatibility for java 6 or 7, because I wanted to be able to run the launcher on older OSes, thank you :)

@K4sum1
Copy link

K4sum1 commented Feb 21, 2023

I was going to test this as well, but guess I don't need to. It would be nice to have it work with Java 6 like the old launcher did.

@bigfoot547
Copy link
Member

When I made this, I wasn't aware people still cared about Java 6. As such, it's not officially supported. Maybe try building it yourself with a java 6 JDK? I've never tried it.

@lousakura
Copy link
Author

Alright thanks for answering

@lousakura lousakura closed this as not planned Won't fix, can't repro, duplicate, stale Feb 22, 2023
@K4sum1
Copy link

K4sum1 commented Feb 22, 2023

Can't just give up that easily lol. Will try building it myself

@lousakura lousakura reopened this Feb 22, 2023
@lousakura
Copy link
Author

Okay, so I tried building it in Java 6 but couldn't as Maven 3.3.1+ requires JDK 7+ and I'm new to all of this so I don't know how to fix it.
Screenshot 2023-02-22 173223

@lousakura
Copy link
Author

lousakura commented Feb 22, 2023

After that I tried building it in Java 7 and this happened.

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Child module C:\Users\luisc\Downloads\olauncher\olauncher\pom.xml of C:\Users\luisc\Downloads\olauncher\pom.xml does not exist @
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project dev.figboot:olauncher-parent:0.1.0 (C:\Users\luisc\Downloads\olauncher\pom.xml) has 1 error
[ERROR] Child module C:\Users\luisc\Downloads\olauncher\olauncher\pom.xml of C:\Users\luisc\Downloads\olauncher\pom.xml does not exist
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

Process finished with exit code 1

And yes, I'm sure I cloned it correctly because I repeated the process 3 times.

@K4sum1
Copy link

K4sum1 commented Feb 22, 2023

How do you run .sh files on Windows? I've been trying to get a Linux VM up with openjdk6.

@K4sum1
Copy link

K4sum1 commented Feb 22, 2023

So I got it kinda working in Linux, but I need a version of fernflower compatible with Java 6 to get further.

@bigfoot547
Copy link
Member

oh true. the decompilation output may be different, so the patches might not apply

@lousakura
Copy link
Author

How do you run .sh files on Windows? I've been trying to get a Linux VM up with openjdk6.

I used Intellij IDEA to run them, don't know if I did it right tho
image_2023-02-22_181702058

@K4sum1
Copy link

K4sum1 commented Feb 22, 2023

Where would I find a older compiled version of fernflower for Java 6?

@bigfoot547
Copy link
Member

fesh0r/fernflower@35259c3 this commit seems like the commit before they began requiring java 8, seems ancient. Are you sure you can't use the java 8 version of fernflower? It may produce output compatible with java 6 with some modification

@K4sum1
Copy link

K4sum1 commented Feb 22, 2023

Is there a flag or something I can set to make it ignore the wrong Java version?

@bigfoot547
Copy link
Member

you will still need to run fernflower with java 8, because a java 6 JRE can't run java 8 class files (the format probably changed)

@K4sum1
Copy link

K4sum1 commented Feb 22, 2023

So decompile with Java 8, then do the rest with Java 6?

@bigfoot547
Copy link
Member

yes

@K4sum1
Copy link

K4sum1 commented Feb 22, 2023

I get this even with Java 8

administrator@administrator-VirtualBox:~/olauncher$ ./applyPatches.sh
Cloning into 'olauncher'...
done.
~/olauncher/olauncher ~/olauncher
From ../launcher

  • [new branch] master -> upstream/master
    HEAD is now at e5a4852 Initial commit
    error: unknown option `no-gpg-sign'
    usage: git am [options] [(|)...]
    or: git am [options] (--continue | --skip | --abort)

    -i, --interactive run interactively
    -3, --3way allow fall back on 3way merging if needed
    -q, --quiet be quiet
    -s, --signoff add a Signed-off-by line to the commit message
    -u, --utf8 recode into utf8 (default)
    -k, --keep pass -k flag to git-mailinfo
    --keep-non-patch pass -b flag to git-mailinfo
    --keep-cr pass --keep-cr flag to git-mailsplit for mbox format
    --no-keep-cr do not pass --keep-cr flag to git-mailsplit independent of am.keepcr
    -c, --scissors strip everything before a scissors line
    --whitespace ... pass it through git-apply
    --ignore-space-change
    pass it through git-apply
    --ignore-whitespace pass it through git-apply
    --directory ... pass it through git-apply
    --exclude ... pass it through git-apply
    --include ... pass it through git-apply
    -C ... pass it through git-apply
    -p ... pass it through git-apply
    --patch-format ... format the patch(es) are in
    --reject pass it through git-apply
    --resolvemsg ... override error message when patch failure occurs
    --continue continue applying patches after resolving a conflict
    -r, --resolved synonyms for --continue
    --skip skip the current patch
    --abort restore the original branch and abort the patching operation.
    --committer-date-is-author-date
    lie about committer date
    --ignore-date use current timestamp for author date
    --rerere-autoupdate update the index with reused conflict resolution if possible

~/olauncher
Patches did not apply cleanly to olauncher. Please fix.

@K4sum1
Copy link

K4sum1 commented Feb 22, 2023

So I got further, but maven automatically set my java back to java 8, and I got this error

Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] olauncher-parent .................................. FAILURE [0.453s]
[INFO] olauncher ......................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.526s
[INFO] Finished at: Wed Feb 22 12:48:12 CST 2023
[INFO] Final Memory: 5M/119M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (http://repo.maven.apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom. Return code is: 501 , ReasonPhrase:Not Implemented. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
administrator@administrator-VirtualBox:~/olauncher$

@K4sum1
Copy link

K4sum1 commented Feb 22, 2023

New VM, copy paste is broken so I'm sending screenshots

Java 6
ScreenShot_20230222144849

Java 7
ScreenShot_20230222144931

@bigfoot547
Copy link
Member

hmm maybe you can run maven with java 8 but set the source/target compatibility to 1.6. That will make it write java 6 class files with a java 8 jdk

@K4sum1
Copy link

K4sum1 commented Feb 23, 2023

How exactly would I do that?

@bigfoot547
Copy link
Member

there should be a thing in the pom.xml

@K4sum1
Copy link

K4sum1 commented Feb 25, 2023

I found a target thing and set it to 1.6 but I get this when compiling.
long error.txt

@bigfoot547
Copy link
Member

You may be able to downgrade or remove that plugin. All it does is generate the version string for the window title and other stuff. Not particularly necessary.

@K4sum1
Copy link

K4sum1 commented Feb 26, 2023

How exactly would I go about doing that?

@bigfoot547
Copy link
Member

edit the pom.xml in the olauncher folder, the plugin configuration should be in there

@K4sum1
Copy link

K4sum1 commented Feb 27, 2023

I replaced it with 4.9.9 and I get this error now
other long error.txt

@bigfoot547
Copy link
Member

Just get rid of the plugin, you don't need it. It's not worth the trouble it's causing you.

@K4sum1
Copy link

K4sum1 commented Feb 27, 2023

I did remove it and got a similar looking error, still have it up to send.
error 3.txt

@bigfoot547
Copy link
Member

you need to set both source and target to 1.6 (you will likely have to modify the code to remove java8-only features that may have been used)

@K4sum1
Copy link

K4sum1 commented Feb 27, 2023

How do I know what's Java 8 or not?

@bigfoot547
Copy link
Member

what doesn't compile when you set source and target to 1.6

@K4sum1
Copy link

K4sum1 commented Feb 28, 2023

very big error.txt

@bigfoot547
Copy link
Member

you're going to have to rectify all of those by replacing them with constructs supported in java 6

@K4sum1
Copy link

K4sum1 commented Feb 28, 2023

I don't know how to do that.

@lousakura
Copy link
Author

@bigfoot547 won't you be able to do it for us pleaseee?

@K4sum1
Copy link

K4sum1 commented Mar 2, 2023

🥺

bruh github pleading emoji sucks

@bigfoot547
Copy link
Member

https://github.com/olauncher/olauncher/tree/java6 try this branch

NOTE: it is unlikely to work - a lot of the libraries are probably compiled for java 8. You may have to find java 6 versions of affected libraries. I cannot test this because I don't have a java 6 jdk.

@K4sum1
Copy link

K4sum1 commented Mar 3, 2023

If you're on Linux, this installs and just works on latest Ubuntu LTS (and probably forks too). Just select Java 6 (or 7) and get the .deb
https://www.azul.com/downloads/
I'll test it myself though to see what happens.

@K4sum1
Copy link

K4sum1 commented Mar 3, 2023

So it compiled without issue. I tried genredist, got an error, but the output jar without genredist works fine, at least with Java 8. For some reason I can't select Java 6 even though it was used to compile in my VM, so I will make a quick XP VM with Java 6 for testing.

@K4sum1
Copy link

K4sum1 commented Mar 3, 2023

Hmm
ScreenShot_20230302200438

@bigfoot547
Copy link
Member

yeah, I suspected that would be the case. You're going to have to find versions of the libraries used for java 6. It shouldn't be too hard, just not something I have the time to do right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants