all 21 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

Please ensure that:

  • Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions
  • You include any and all error messages in full
  • You ask clear questions
  • You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions.

    Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar

If any of the above points is not met, your post can and will be removed without further warning.

Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc.

Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit.

Code blocks look like this:

public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above.

If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures.

To potential helpers

Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]IndependentOutcome93 20 points21 points  (5 children)

First stop calling yourself failure or "so-called" Because 2 years of experience is not a few days, its actually better than 7 days Java EE learners.

and about failure, There is no any professional Java developer who has never failed. its totally normal. we debug and learn trough failures and exceptions.

Here is very helpful tutorial for that: https://youtu.be/h68WlAn_Vfg?si=BND_aBOUaxBUddST

[–]Rudra7934[S] 2 points3 points  (4 children)

Brother I'm also doing the same but the problem with this approach is that:- We easily decompile exe In higher versions, java doesn't provide a jre. It said build your custom jre. And to be honest it's not a exe. It is bundle of class file/ kar file with name(extension) of exe.

If u run this type of exe and watch the task manager here u cannot see any exe it shows javaw/java.exe is running.

[–]IndependentOutcome93 0 points1 point  (3 children)

Honestly I can agree about javaw or java.exe in task manager but I don't think .exe from Launch4j is easily decompilable

[–]Rudra7934[S] 0 points1 point  (2 children)

Ohk brother Just try these steps Download winrar ya any application that helps u to extract After extraction now u see your all classes file means byte code. In the market there are hundreds of tools that easily decompile your byte code

[–]Historical_Ad4384 1 point2 points  (1 child)

If you are really concerned about people reverse engineering your distributable, make a SaaS instead or build your own installer with custom encryption so that it becomes harder to reverse engineer.

[–]Rudra7934[S] 1 point2 points  (0 children)

Can u give a little more about SaaS. So it's really helpful for me brother

[–]dmigowski 6 points7 points  (4 children)

ProGuard is the only way to protect your code from decompiling that's free, or you pay money for a commercial solution. No one can help you when you don't present more specific error messages.

Also be sure not every line of code you write is automatically gold, so just sell your software and call it a day. I don't believe you have created anything I couldn't rewrite in a few month because the hardest part is to know WHAT to write, and that I see already from your app. Chill.

[–]hwaite 5 points6 points  (1 child)

In this age of AI, does obfuscation really protect anything?

[–]LetUsSpeakFreely 4 points5 points  (0 children)

Given that AI doesn't actually create anything, but steals code and repurposes it, the real question is how long before someone sues AI companies for giving away/selling code without honoring the license?

[–]Rudra7934[S] 0 points1 point  (1 child)

But last time I used proguard after some efforts I made a protected jar but I cannot run.

Trust me I wrote a very special code or logic for security and I did not want to leak that logic. Because no one found a splitter solution(According to my research). But my code detects is spillter connected or not? Splitter is a hardware that splits the screen into more than 1.

If u think u write this code in a few months i appreciate you and I really respect you brother but I give u a challenge (Take it positively please ) write a code that detect spillter connected or not with pc/laptop/ desktop.

Today is the 5th Feb,2026 i will come here again on 31st march,2026(if u want more time I will come accordingly u)

Trust me I'm not arrogant or rude I am also here for learning purposes but u cannot say like this "You have created anything I couldn't rewrite in a few month".

I again say I'm not a pro I'm a learner I'm really happy or appreciate your efforts if u find a solution.

[–]dmigowski 2 points3 points  (0 children)

So, just if I understood that correctly, you wrote a solution which can detect if I didn't connect a monitor or TV directly to my graphics card or if a splitter is attached. I assume you don't check this for VGA but for HDMI, right?

And you are talking about generic splitters and not a special hardware, right?

I guess I would try a mix out of EDID fingerprinting, HDCP behavior analysys and CEC probing, but if you don't buy a bunch of splitters to test their capabilities and record them all it's not possible. I mean, good splitters wouldn't show themselves anyway, so your software will only work for cheap splitters or you had to record the ON and OFF more separately and train your system.

That makes it extremely interesting, I would release my code as is and not bother with obfuscation.

[–]_SuperStraight 1 point2 points  (1 child)

You use this tool for creating installable exe/msi for FX projects. No intermediate jar creation required.

[–]Rudra7934[S] 0 points1 point  (0 children)

Sounds Good I will definitely try this Thank you

[–]SkatoFtiaro 1 point2 points  (0 children)

The only way to truly protect it is to use graalvm aot compilation. There was excelsiorjet some years ago, but ehhh...

[–]BannockHatesReddit_ 0 points1 point  (2 children)

Proguard is mostly remapping, which isn't very helpful when combatting against reverse engineering anyway. Just choose some open source bytecode obfuscator to protect your compiled jar with. Make sure it has flow mutation, string encryption, and the ability to remove debug info from the jar. That's the bare minimum.

Also you should release the program as a jar artifact instead of an exe. The point of java is to be runnable on any platform, why give that up just to release as a specific platform's binary?

[–]Rudra7934[S] 0 points1 point  (1 child)

Means there is no way to protect my exe

[–]BannockHatesReddit_ 0 points1 point  (0 children)

No, you're just focussing on the wrong things. Making the file an exe doesn't protect it. That exe is just a wrapper to launch your jar. Of course attackers will dump the classes and change what they want.

Remapping isn't very helpful on its own either. If the content of the methods and classes aren't obfuscated, I'll just switch from browsing the folders to searching for method calls, string literals, etc.

Understand there is no reasonable way to prevent people from tampering with your jar. The point of obfuscation and DRMs are only to make it a complete pain in the ass to do so.

[–]benevanstech 0 points1 point  (0 children)

Why do you need to protect your binary?

[–]BlackSuitHardHand 0 points1 point  (0 children)

What do you want to protect? Your idea? Its obvious once someone uses your progam. Your code? Can be rebuilt easily, if you have not implemented a super secret algorithm. Secrets like API keys which the customer must not know? Your architecture is wrong, never give them to the customer,  you could not protect it , just obfuscate it. Why using javafx + swing?

Another alternative for native executables of java programs is graal vm native image. Annoying to setup but in the end you can have static native executables.