1

I want to include my .jar file on webpage . Please tell me how to achieve this so that it runs smoothly on all browsers and my second problem is regarding security of my .jar file on client-side(webpage).

I want a way by which I can secure my jar file from getting exposed to outside user as they could easily download and then can easily decompile it to view source code. I don't want my code to get exposed to outside world. I know, I have an option to upload .jar on the server side but due to the design of my project I somehow want to include it on client-side. Can someone please tell me how can I hide .jar file from outside world or how can I encrypt .jar file or how can I make it totally inaccessible to users and at the same time making it available only to my program so that it can communicate with .jar. Please help.

Mohit Gamot
  • 19
  • 1
  • 7
  • Possible duplicate of [How to obfuscate Java code quickly?](http://stackoverflow.com/questions/2124121/how-to-obfuscate-java-code-quickly) – seenukarthi Oct 19 '16 at 12:22
  • 1
    you can't! your code is always readable in some way. You can make it harder to read but you cannot hide it. At least the computer must be able to read it in order to execute it. On the other hand: How are you learnig to code? you look at others code. What if every coder had your attitude? – Timothy Truckle Oct 19 '16 at 12:31
  • Your code will never run on "on all browsers" as most browsers has dropped plugin support which is required for Java applets. Firefox will drop support at the end of the year - then the only common browser left capable loading applets is IE. – Robert Oct 19 '16 at 12:55
  • Ok. But once I obfuscate the code will my program be able to run smoothly ? – Mohit Gamot Oct 19 '16 at 12:58
  • @Robert due to some unavoidable reasons I somehow want to upload my .jar file on client side. I know applets are deprecated but is there any other good way to include jar file on webpage ..? – Mohit Gamot Oct 19 '16 at 13:00
  • @user2376792: Java Webstart is a potential solution. – Robert Oct 19 '16 at 15:04

2 Answers2

0

You can scramble / obfuscate your bytecode with yGuard or other java-bytecode-obfuscators.

facundop
  • 482
  • 6
  • 28
  • ok got it, Thanks a lot. But could you please tell me how can I include or upload my jar file in html webpage. I know applets are deprecated but is there any other way by which I can do it...? – Mohit Gamot Oct 19 '16 at 12:54
0

check this link it might help you

Java™ Web Start With Java Web Start, you launch applications simply by clicking on a Web page link.

Ahmad Nadeem
  • 2,056
  • 1
  • 18
  • 19