Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (590)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Java Security BS, Can I Get Around It?  (Read 1560 times)
0 Members and 1 Guest are viewing this topic.
Offline tyeeeee1
« Posted 2013-12-27 21:46:22 »

Hey,

I finally managed to get my game working as an applet off of my site but nobody can play it without lowering their Java security settings. Can I get around this utterly stupid restriction somehow so that people can actually play the game?

http://valkryst.us.to/games/space_game/space_game.php - This is the page that my game is on.

Here is the code in my html file running the applet:
<applet archive="SpaceGame.jar" code="core/Applet.class" width="1024" height ="548">

The applet is packed into a fat jar using eclipse.

I've looked around, but everyone just says to lower your security settings. I don't want anyone to have to do that to play the game.
Online trollwarrior1
« Reply #1 - Posted 2013-12-27 21:47:33 »

Sorry to say this, but I don't think it is possible.
Offline jonjava
« Reply #2 - Posted 2013-12-27 21:49:54 »

Yes, don't use Applet.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline tyeeeee1
« Reply #3 - Posted 2013-12-27 21:51:34 »

Yes, don't use Applet.

How else would I get the game onto the site then?
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 835
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #4 - Posted 2013-12-27 21:55:16 »

flash, html5-canvas, or create a fancy installer

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline tyeeeee1
« Reply #5 - Posted 2013-12-27 21:59:31 »

flash, html5-canvas, or create a fancy installer

Can I draw directly to the html5 canvas using Java?
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 835
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #6 - Posted 2013-12-27 22:03:43 »

nope, you need libgdx and use its html5 export (i never used it, but people say it works)

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline tyeeeee1
« Reply #7 - Posted 2013-12-27 22:04:57 »

=___= So much work just to do something that should already be simple to do. FFS... Now to go spend hours figuring out libgdx and all that crap...
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 78
Projects: 15


★★★★★


« Reply #8 - Posted 2013-12-27 22:05:50 »

Yeh, for Java and HTML5/WebGL, you'll have to use something like GWT (its the solution LibGDX uses atm).

As for actual java applets, you can still get them working without lowering your java security settings (even though it seems Oracle don't want you to anymore due to how many roadblocks they've put up). You'll have to follow the correct steps and jump all the hoops (like including the correct values in the Manifest.MF file of each jar), see the Applet documentation. An example here.
Offline tyeeeee1
« Reply #9 - Posted 2013-12-27 22:10:19 »

Yeh, for Java and HTML5/WebGL, you'll have to use something like GWT (its the solution LibGDX uses atm).

As for actual java applets, you can still get them working without lowering your java security settings (even though it seems Oracle don't want you to anymore due to how many roadblocks they've put up). You'll have to follow the correct steps and jump all the hoops (like including the correct values in the Manifest.MF file of each jar), see the Applet documentation. An example here.

Know a guide for that? I'd rather jump through a bunch of hoops than have to learn libgdx and edit all of my code (probably).
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 78
Projects: 15


★★★★★


« Reply #10 - Posted 2013-12-27 22:16:54 »

have a read of http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html
Offline tyeeeee1
« Reply #11 - Posted 2013-12-27 22:50:37 »


I've gone through it and edited the manifest, but it still gives the security block.

Quote
Manifest-Version: 1.0
Trusted-Library: true
Trusted-Only: false
Application-Name: Valkryst - Space Game
Permissions: sandbox
Created-By: Fat Jar Eclipse Plug-In

I did have the "Trusted-Only:" set to true before, but it gave an error.
Offline CommanderKeith
« Reply #12 - Posted 2014-01-02 22:41:56 »

Hi,
I can't see your URL (404 error) to test your problematic applet, but have you signed all of your jar files correctly?
I use this script to make my applets work:

http://www.java-gaming.org/topics/ant-build-script-for-making-a-keystore-and-signing-all-jar-files/24532/msg/206697/view.html#msg206697

Cheers,
Keith

Online kpars

JGO Kernel


Medals: 107
Projects: 4
Exp: 4 years


Extreme Typist.


« Reply #13 - Posted 2014-01-03 02:18:30 »

You could do what I do, and not use Java.

Online matheus23

JGO Kernel


Medals: 113
Projects: 3


You think about my Avatar right now!


« Reply #14 - Posted 2014-01-03 14:17:36 »

If you want something in the browser that simply works on most machines, use html5, canvas and javascript.

Javascript is easy to learn (but has nothing to do with java, actually) and easy to use (for !!small!! things).

So if you want to create some kind of little simulation or similar you can use javascript Smiley
Also, it might be interesting to learn. You will find things you've never seen before, like the fact that javascript is prototype based and not OOP (but you can 'implement' OOP in javascript, which is quite cool and interesting) or that everything is some kind of object you can pass around, even functions. So you can pass a function as an argument to a method call, for example.

It's worth learning! Smiley

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline Mac70
« Reply #15 - Posted 2014-01-03 14:39:02 »

You can always use Java to make JavaScript projects using http://www.gwtproject.org/ - IMO this is much better than writing anything in plain JS as you can use all Java features useful for projects larger than simple calculator like packages, source code in multiple files etc. Smiley

Check out my Devblog! Smiley
Online matheus23

JGO Kernel


Medals: 113
Projects: 3


You think about my Avatar right now!


« Reply #16 - Posted 2014-01-03 14:42:39 »

You can always use Java to make JavaScript projects using http://www.gwtproject.org/ - IMO this is much better than writing anything in plain JS as you can use all Java features useful for projects larger than simple calculator like packages, source code in multiple files etc. Smiley

You can have source code in multiple files using Javascript Wink

But I partly agree. You should use Java when you have bigger projects.

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline Mac70
« Reply #17 - Posted 2014-01-03 19:32:27 »

You can have source code in multiple files using Javascript Wink

I named this wrong, I was thinking about "one class = one file", like in Java - this makes development much, much easier. Smiley JS is also lacking a good IDE.

Check out my Devblog! Smiley
Offline Mike

« JGO Spiffy Duke »


Medals: 86
Projects: 1
Exp: 6 years


Java guru wanabee


« Reply #18 - Posted 2014-01-03 20:26:50 »

JS is also lacking a good IDE.

Sublime text is actually quite good. It even has things like content assist.

Mike

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Online matheus23

JGO Kernel


Medals: 113
Projects: 3


You think about my Avatar right now!


« Reply #19 - Posted 2014-01-03 20:41:16 »

JS is also lacking a good IDE.

This is, sadly, true, I'd say. I love Sublime Text, but it's just impossible to build an IDE which is as good as Eclipse / IntelliJ for java for javascript, because type information is only available at runtime (is it an int? is it a boolean? maybe both? Has this object got the field 'test' or not? When does it have it? when not?...).

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 835
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #20 - Posted 2014-01-03 20:43:15 »

Jetbrains/WebStorm is a fancy JS/HTML IDE. It even supports javascript breakpoints which you set in the IDE, which affect the running code in the browser (!) with variables showing in your IDE -- you either watch the stack-frame, or hover the variables in your code, where their current values show in the tooltips. Mind is blown. It's not free, but has a 30 day trial.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline tyeeeee1
« Reply #21 - Posted 2014-01-03 20:50:09 »

@CommanderKeith:

The link is fixed. I'm pretty sure I've signed them correctly using these two .bat files:

Generate the keystore:
1  
"C:\Program Files\Java\jdk1.7.0_25\bin\keytool.exe" -genkey -keystore myKeystore -alias Valkryst


Sign the Jar:
1  
2  
"C:\Program Files\Java\jdk1.7.0_25\bin\jarsigner.exe" -keystore myKeystore SpaceGame.jar Valkryst
pause


As far as I can see the applet seems to be working, but I haven't had anyone test it in the last few days so I can't say for sure.



@matheus23

JavaScript would be an alright option for some things, but I don't see myself rewriting everything just to use it.



@kpars

XD Good idea. I've already started learning C++ since Java seems to be kind of eh for certain projects I'm working on.



I've found Sublime to be a good replacement for Notepad++ which I've been using for a few years. After you get it *cough* without all those trial popups and that it's quick and not annoying in any way so-far. I would never use it for Java, but for HTML, CSS, etc... it's perfectly fine for me.
Offline Mac70
« Reply #22 - Posted 2014-01-03 21:13:10 »

Jetbrains/WebStorm is a fancy JS/HTML IDE. It even supports javascript breakpoints which you set in the IDE, which affect the running code in the browser (!) with variables showing in your IDE -- you either watch the stack-frame, or hover the variables in your code, where their current values show in the tooltips. Mind is blown. It's not free, but has a 30 day trial.

You can do the same thing (breakpoints, variables showing in IDE) using free GWT - while writing and debugging code in Java, from the Eclipse (sadly no NetBeans). Smiley

Check out my Devblog! Smiley
Offline CommanderKeith
« Reply #23 - Posted 2014-01-03 21:36:32 »

@CommanderKeith:

The link is fixed. I'm pretty sure I've signed them correctly using these two .bat files:

Well it works for me in Chrome browser on windows, but requires clicking through 2 menus, one by chrome which isn't too scary and one by oracle which is quite off-putting.

I read recently that Google is shutting down the old netscape plugin API which affects java:
http://www.infoworld.com/d/applications/chrome-will-block-npapi-plug-ins-over-stability-security-concerns-227428
Quote
While click-to-play has been available in Chrome for several years, the feature has not been enabled by default, except for a number of plug-ins that Google considered to present a higher security risk, like Java, RealPlayer, QuickTime, Shockwave, Windows Media Player and Adobe Reader prior to Adobe Reader X. That policy will soon change.

"Starting in January 2014, Chrome will block webpage-instantiated NPAPI plug-ins by default on the Stable channel," Schuh said. A temporary exception will be made for the most popular NPAPI plug-ins that are not already being blocked for security reasons in order to avoid disruption to users, he said.

The plug-ins that will be temporarily whitelisted will be Silverlight, Unity, Google Earth, Google Talk and Facebook Video, as they were used by more than 5 percent of users during the past month. Java was used by almost 9 percent of users, but it's already on the list of blocked plug-ins.

"In the short term, end users and enterprise administrators will be able to whitelist specific plug-ins," Schuh said. "Eventually, however, NPAPI support will be completely removed from Chrome."

Offline tyeeeee1
« Reply #24 - Posted 2014-01-04 00:09:42 »

=_____________________________________________________________________________________________________________________________________________________________________=

That is the only thing that has ever made me hate Google...
Offline StumpyStrust
« Reply #25 - Posted 2014-01-04 11:43:18 »

I don't get it. If you properly separated logic from rendering and were not doing anything too fancy with the rendering you could switch to libgdx in a day or 2. You do NOT have to use any special libgdx stuff. As a matter of fact I ported of my SystemX particle system in 2 hours because I only needed to change a few methods.

particle.render();
SystemX.render();

If you keep things nice and separate like this, then porting to another framework (not language) is quite easy.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

trollwarrior1 (29 views)
2014-11-22 12:13:56

xFryIx (71 views)
2014-11-13 12:34:49

digdugdiggy (50 views)
2014-11-12 21:11:50

digdugdiggy (44 views)
2014-11-12 21:10:15

digdugdiggy (38 views)
2014-11-12 21:09:33

kovacsa (62 views)
2014-11-07 19:57:14

TehJavaDev (67 views)
2014-11-03 22:04:50

BurntPizza (64 views)
2014-11-03 18:54:52

moogie (80 views)
2014-11-03 06:22:04

CopyableCougar4 (80 views)
2014-11-01 23:36:41
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!