Is the documentation still valid? (Solved)

SadiQ

  • Posts: 1771
Acording to http://www.stencyl.com/help/view/creating-extensions/ under First Steps I see the following
Code: [Select]
Add sw.jar to the project's classpath and edit build.xml as directed.The sw.jar file in question is nowhere to be found on my system.
If I try to build using Eclipse I see a Build Successful message in the output panel along with a warning message:
Code: [Select]
Buildfile: C:\Users\Luci\Desktop\blackTUT\eclipseWorkspace\Sample Project\build.xml
dist:
   [delete] Deleting directory C:\Users\Luci\Desktop\blackTUT\eclipseWorkspace\Sample Project\build
    [mkdir] Created dir: C:\Users\Luci\Desktop\blackTUT\eclipseWorkspace\Sample Project\build
    [javac] C:\Users\Luci\Desktop\blackTUT\eclipseWorkspace\Sample Project\build.xml:30: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
     [copy] Copying 1 file to C:\Users\Luci\Desktop\blackTUT\eclipseWorkspace\Sample Project\build
      [jar] Building jar: C:\Users\Luci\AppData\Roaming\Stencyl\stencylworks\extensions\SampleExtension.jar
BUILD SUCCESSFUL
Total time: 390 milliseconds

If I open up Stencyl after that I get an error message in the logs:
Code: [Select]
Level:     ERROR
When:      2014-11-13 14:07:41
From:      stencyl.sw.app.ExtensionManager

SampleExtension

Throwable: java.lang.ClassNotFoundException: SampleExtension
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at stencyl.sw.app.ExtensionManager.getExtension(ExtensionManager.java:61)
at stencyl.sw.Initializer.loadExtensions(Initializer.java:123)
at stencyl.sw.Initializer.init(Initializer.java:61)
at stencyl.sw.SW$1.run(SW.java:180)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

I assume it's because of the missing sw.jar file?

« Last Edit: November 13, 2014, 09:14:17 pm by SadiQ »
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

captaincomic

  • *
  • Posts: 6109
I haven't worked with toolset extensions yet, so I don't know the steps. But sw.jar is the main Stencyl executable, it should be in your Stencyl installation directory.

SadiQ

  • Posts: 1771
I added the path to the Stencyl install dir and it seems that nothing gets changed(as in I see the same warning message in eclipse) . When I open up Stencyl I see a dialow window with the following error in it:
Code: [Select]
Unexpected problem on thread AWT-EventQueue-0: null
java.lang.NullPointerException
at stencyl.sw.Initializer.loadExtensions(Initializer.java:124)
at stencyl.sw.Initializer.init(Initializer.java:61)
at stencyl.sw.SW$1.run(SW.java:180)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

In the log viewer I see the same error message as I mentioned in my previous post.
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

Hectate

  • *
  • Posts: 4643
I know that I had to do this myself also; note that the README.txt that comes with the sample extension describes it a little differently:
Quote
========================
STEP 1
========================

Configure your project's classpath to include sw.jar
(which you can find in your StencylWorks directory)

For Eclipse, you do this by visiting:
Project > Properties > Java Build Path (in left pane) > Libraries

Then clicking "Add JARsÉ" and picking sw.jar out.
Which is pretty much what I did I believe.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

Hectate

  • *
  • Posts: 4643
We figured out what was  going on in IRC. Apparently the Sample Extension's build.xml points to the work directory for both the final location of the extension.jar as well as sw.jar. Of course, sw.jar is not stored there, but in the install directory. I had overwritten that line (32, in my build.xml) with the direct path to sw.jar in the Program Files (x86)/Stencyl directory path.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

SadiQ

  • Posts: 1771
I'll post what I had to do to get things going, using a fresh eclipse install (in case I need to do it again) :

1. Create a folder somewhere to let Eclipse use as a workspace folder.
2. Extract the content of the Stencyl SDK  somewhere, and copy the Sample Project folder in the eclipse workspace folder you created in step 1.
3. Open Eclipse, point it to use the folder you created in step1 as the workspace folder.
4. Go to File -> New ->Java Project, and for the name type Sample Project and press Next. (http://i.imgur.com/fSwOS2G.png)
5. Go to the Libraries tab, and select Add External JARs, locate the Stencyl install dir and add sw.jar from it then Click Finish. (http://i.imgur.com/T0oJctM.png)
6. Open build.xml in eclipse and edit accordingly. (http://i.imgur.com/6JI7s1D.png)
7. Go to Project -> Properties ->Java Compiler and click on  Configure Workspace Settings (upper right corner)
8. Under Compiler Compliance level select 1.6 and after that click on Configure (http://i.imgur.com/1aL3KWc.png)
9.Click on Add in the window that appears, select Standard VM, and in the next window select Directory and navigate to your Jdk1.6 install dir (http://i.imgur.com/KrhiMYE.png)
10. Click Finish. You will be returned to the Preferences window where you must select the new jdk instead of the default one (http://i.imgur.com/q8irQPr.png)
11. Click all the OK and Finish buttons that may come up in the process, right click build.xml, select RunAs Ant Build and things should work (if you can actually stand those 42 warning messages)
12. Go to Run -> External Tools ->External Tools Configurations, select the JREs tab and make sure you have Separate JRE selected and that it points to jdk1.6 (http://i.imgur.com/556bHnU.png)
13. Click Apply then Run and eclipse should recompile the extension (Without 42 warnings this time)
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.