NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
November 23, 2017, 04:41:52 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
"Reflect, review and renew constantly." ...Wisdom
Google Bookmarks Yahoo My Web MSN Live Netscape Del.icio.us FURL Stumble Upon Delirious Ask FaceBook

Pages: [1]   Go Down
  Print  
Author Topic: Using own classes with import possible  (Read 15452 times)
0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
juliaB
Newbie
*
Offline Offline

Posts: 5

«
Embed this message
on: October 04, 2011, 11:11:22 pm » posted from:TAUNTON,ENGLAND,UNITED KINGDOM

Hello,

is it possible to use own classes in an ejs simulation that are packed in a jar file.

I tried to pack my class in a jar file and did put it in ejs under run option in jar libraries, and tried an import (also under run option), but that did not work.

If anybody has successfully done so, I would be grateful for a step by step explanation.

Right now I did make an ejs simulation, put the classes made by ejs in eclipse, made some improvements (including new classes) and now would like to get those back in ejs.

I can just copy the new classes in my ejs simulation, but that only sort of works, meaning, everything works like in eclipse, but in the console there are many complaints about my classes I do not get with them in an extra file in eclipse. Also it makes the code less reusable.

Thank you,

Julia

Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #1 on: October 05, 2011, 04:59:22 pm » posted from:Taipei,T'ai-pei,Taiwan

Please check out EJS version of Fourier Synthesis (You can hear the sound,too!).

I create my own java class to generate sound, and added it to EJS.

Add jar under run option, and add import statement, then you should be able to used it in the code.

Please do check out the above example.
Logged
juliaB
Newbie
*
Offline Offline

Posts: 5

«
Embed this message
Reply #2 on: October 06, 2011, 05:05:43 am » posted from:TAUNTON,ENGLAND,UNITED KINGDOM

Hello again,

thank you so much for the example, I now was able to use a class out of a jar file, I had only put the Jar File in the Field Jar Libraries under Run Configurations and not also under Files required. I would never have guessed without the example, that this was the problem.

Julia
Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #3 on: October 06, 2011, 02:59:58 pm » posted from:Taipei,T'ai-pei,Taiwan

Great! You can make it.
I hope you can post your result and share it with other users soon!  Grin
Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #4 on: October 06, 2011, 08:31:04 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

yes juliaB,
do share your creative works in this forum  Grin
Logged
juliaB
Newbie
*
Offline Offline

Posts: 5

«
Embed this message
Reply #5 on: October 07, 2011, 07:02:09 pm » posted from:Warwick,Warwickshire,United Kingdom

As soon as I am finished to my satisfaction I will post my work. Thank you for your encouragement.

Julia
Logged
alempitt
Newbie
*
Offline Offline

Posts: 1

«
Embed this message
Reply #6 on: November 09, 2011, 05:35:51 pm » posted from:Mission Viejo,California,United States

How can I use EJS in ExpressJS instead of Jade???
-*-
Logged
juliaB
Newbie
*
Offline Offline

Posts: 5

«
Embed this message
Reply #7 on: July 12, 2013, 06:04:12 pm » posted from:Warwick,Warwickshire,United Kingdom

It seems to have taken me a long time to post the result, but please accept my thanks for your encouragement.

« Last Edit: July 12, 2013, 06:42:58 pm by juliaB » Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #8 on: July 12, 2013, 06:10:04 pm » posted from:,,Satellite Provider

Great! You can upload ejs created jar file by yourself,too!

You will find "upload new EJS jar file" check box just below the edit region when you post message.
Click the check box , then select jar file.
The jar file will be uploaded when the message is saved.
And the simulation will appear automatically as part of message.
Try it. I will help you to make it work if you can not make it work.
Logged
juliaB
Newbie
*
Offline Offline

Posts: 5

«
Embed this message
Reply #9 on: July 12, 2013, 06:44:36 pm » posted from:Warwick,Warwickshire,United Kingdom

Here it comes?!
Logged
Pages: [1]   Go Up
  Print  
"Reflect, review and renew constantly." ...Wisdom
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.063 seconds with 21 queries.since 2011/06/15