don't work

57 views
Skip to first unread message

lg...@ioerj.com.br

unread,
Mar 13, 2018, 3:21:30 PM3/13/18
to CheerpJ Developers

Can't run 

<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>CheerpJ test</title>
    
  </head>
  <body>
  </body>
  <script>
cheerpjInit();
cheerpjCreateDisplay(800,600, document.getElementById("target"));
cheerpjRunJarWithClasspath("DOeApplet-128e.jar","/app/DOeApplet-128e.jar:/app/DOeApplet-128e.jar");
    </script>
</html>

<html>


Alessandro Pignotti

unread,
Mar 14, 2018, 12:28:53 PM3/14/18
to CheerpJ Developers, Leonardo Nolasco Gama
Hello Leonardo,

there is a misunderstanding in the way JAR paths must be used. Let me clarify with an example:

Page URL: http://127.0.0.1:8080/directory/page.html
JAR URL: http://127.0.0.1:8080/directory/application.jar
CheerpJ call: cheerpjRunJar("/app/directory/application.jar");

The "/app/" directory in CheerpJ correspond to the root directory of the Web Server

/app/exampleDir/exampleFile.txt -> http://127.0.0.1:8080/exampleDir/exampleFile.txt

I hope this helps,
Alessandro

On Wed, Mar 14, 2018 at 1:27 PM, Leonardo Nolasco Gama <lg...@ioerj.com.br> wrote:
Don't work again

my page

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>CheerpJ test</title>
    
  </head>
  <body>
  </body>
  <script>
cheerpjInit();
cheerpjRunJar("teste/app/DOeApplet-128e.jar");

    </script>
</html>

<html>




Atenciosamente,
Leonardo Nolasco Gama


Centro de Processamento de Dados
Imprensa Oficial do Estado do Rio de Janeiro
21 2717-5276 Ramal:4497


2018-03-14 5:54 GMT-03:00 Alessandro Pignotti <aless...@leaningtech.com>:
Hello,

I see at least 2 problems in your setup

1) The page is being run directly from the disk (i.e. the URL starts with file://). That is not supported, a local Web server _must_ be used.
2) The first argument of cheerpjRunJarWithClasspath must be also an absolute path, it should start with /app/

Moreover, using the cheerpjRunJarWithClasspath in your case is redundant. There is only 1 jar used multiple times. Simplify the code by using just

cheerpjRunJar("/app/DOeApplet-128e.jar");

Keep in mind that this command is equivalent to using "java -jar DOeApplet-128e.jar" on the command line. You can use native java to make sure that the program behaves as expected before running on CheerpJ.

Alessandro

--
You received this message because you are subscribed to the Google Groups "CheerpJ Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cheerpj-developers+unsubscribe@googlegroups.com.
To post to this group, send email to cheerpj-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/cheerpj-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/cheerpj-developers/074143c1-5d86-477b-9800-bae1b5bffc59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Leaning Technologies Limited

Alessandro Pignotti
CTO
aless...@leaningtech.com

Leaning Technologies Limited 
www.leaningtech.com

Twitter  Facebook  LinkedIn 





--

Leaning Technologies Limited

Alessandro Pignotti
CTO
aless...@leaningtech.com

Leaning Technologies Limited 
www.leaningtech.com

Twitter  Facebook  LinkedIn 

Reply all
Reply to author
Forward
0 new messages