Unable to run Javascript on Truffle [on hold]

Following is the code I am using:

public class test {

public static void main(String[] args) throws Exception {     // TODO Auto-generated method stub     String name = "input.js";     String dir = "/home/kontrol/Desktop/";     File file = new File(dir, name);     // assert name.endsWith(".js"); // : "Imagine 'c:\\sources\\Example.js' file";     PolyglotEngine vm = PolyglotEngine.newBuilder().build();      Source source = Source.newBuilder(file).build();      assert file.getName().equals(source.getName());     assert file.getPath().equals(source.getPath());     assert file.toURI().equals(source.getURI());     assert "text/x-javascript".equals(source.getMimeType());     System.out.println(source.getMimeType());     System.out.println(source.getName());     System.out.println(source.getPath());     System.out.println(source.getURI());      vm.eval(source);  } 

Following is the error I get:

Exception in thread "main" java.lang.NullPointerException at com.oracle.truffle.js.engine.JavaScriptLanguage.createContext(JavaScriptLanguage.java:204) at com.oracle.truffle.js.engine.JavaScriptLanguage.createContext(JavaScriptLanguage.java:51) at com.oracle.truffle.api.TruffleLanguage$LangCtx.(TruffleLanguage.java:339) at com.oracle.truffle.api.TruffleLanguage$Env.(TruffleLanguage.java:391) at com.oracle.truffle.api.TruffleLanguage$LanguageImpl.attachEnv(TruffleLanguage.java:561) at com.oracle.truffle.api.vm.PolyglotEngine$Language.getEnv(PolyglotEngine.java:1180) at com.oracle.truffle.api.vm.PolyglotEngine$Language.getEnv(PolyglotEngine.java:1174) at com.oracle.truffle.api.vm.PolyglotEngine$Language.getImpl(PolyglotEngine.java:1154) at com.oracle.truffle.api.vm.PolyglotEngine.evalImpl(PolyglotEngine.java:563) at com.oracle.truffle.api.vm.PolyglotEngine.eval(PolyglotEngine.java:532) at com.oracle.truffle.api.vm.PolyglotEngine.eval(PolyglotEngine.java:469) at com.oracle.truffle.api.test.main(test.java:32)<--this is the vm.eval(source) line above

I can not figure out why Javascript's createContext is failing. I do not have its .java file and I have no pointers as to where to look for a solution.

I am running this on Ubuntu 16.04, Eclipse IDE.

Any hints

Replay

Category: jvm Time: 2016-07-30 Views: 0
Tags: jvm

Related post

  • Unable to run JavaScript in Modal froms in SharePoint 2010 2012-10-17

    I have multiple lines of JavaScript codes running in a Survey form "editForm.aspx". When I browse editForm.aspx directly it works well, but when I open the form by clicking 'respond to this survey' the dialog modal form opens and the JS code dos

  • unable to run an javascript using a firefox's bookmarklet,it return [object HTMLScriptElement] 2016-01-31

    Totally newbie about JS. I am having similar issues from unable to run an external javascript using a bookmarklet. Why does my Javascript return [object HTMLScriptElement] instead of expected text? I need to use an external script which modifies some

  • Enable IE6 to run JavaScript 2009-11-06

    How do I enable IE6 to run JavaScript? Where in the settings do I set this option? --------------Solutions------------- Tools > Internet Options > Security Then select the Internet zone if it's not already selected. Click Custom Level... Scroll down

  • Run javascript code on Form Submit 2011-06-01

    I want to run JavaScript code upon a form being submitted preceding other default tasks that are carried out on form submission. May anyone suggest some approaches? --------------Solutions------------- Depending on the type of code that you need to r

  • Unable to run Sakis3g after downgrading to gnome 2? 2011-07-03

    After downgrading to Gnome 2 from Gnome 3 in Ubuntu 11.04 I was unable to run sakis3g. Whenever I run it nothing open up. Yes I have checked to execute the script in permissions. I was able to open it before upgrading to Gnome 3. error message ** (ze

  • Unable to run apps requiring OpenGL support 2012-02-13

    Recently upgraded my onboard Nvidea graphics chip with an ATI Radeon Sapphire X800XL PCIe graphics card. Ever since I am unable to run Stellarium. I get the error "This system does not support OpenGL". The only thing that has changed since I las

  • Is it possible to run javascript on plugin deactivated? 2012-04-21

    Is it possible to run javascript on plugin deactivated and if yes then, how should I achieve that. I have developing one plugin in which two new tables are created in wp database and on deactivation I want to confirm from users if he/she wants to del

  • Unable to run VMware Player 3.0.0-203739 on Ubuntu 12.04 LTS 2012-07-16

    As the title states I am unable to run VMware player 3.0.203739 on a Ubuntu 12.04 LTS system, when attempt to run the program I get the following error message : "Kernel Headers 3.2.0-23-generic-pae Kernel headers for version 3.2.0-23-generic-pae wer

  • Is it possible to run JavaScript and also edit image maps using Design View in Dreamweaver? 2012-09-17

    I'm using Dreamweaver CS5.5 for an HTML prototype that is built with image-mapped screenshots. I am using JavaScript to dynamically include the appropriate main image, and the navigation is done with image maps. I found some references to the "Live V

  • RUNAS ERROR: Unable to run - The system cannot find the file specified 2012-09-25

    If I run runas /savecred /user:yogurt\administrator "del c:\testt" I get this error Attempting to start del c:\testt as user "yogurt\administrator" ... RUNAS ERROR: Unable to run - del c:\testt 2: The system cannot find the file specif

  • Unable to run commands with "sudo" from my user 2012-10-05

    For some reason, I am unable to run any commands with su as my user. This was working before and I'm not sure what broke it. The funny thing is that I can su to root without any problems. Example: machine:~ myuser$ who myuser console Sep 28 01:10 myu

  • Unable to run svn commands on a repository version 1.7 2013-08-28

    I'm unable to run svn commands in an existing repository. Running svn status results in this : [email protected]:~/Dropbox/CDS$ svn status svn: The path '.' appears to be part of a Subversion 1.7 or greater working copy. Please upgrade your Sub

  • Cannot recover the master database. SQL Server is unable to run 2013-09-23

    Right, I powered off development server because it was hanged, when restarted directory services database was corrupted, so fixed it, then figured out that IIS Manager's metadata.xml is messed up, so fixed it using backup too. But now SQL Server serv

  • Run JavaScript after "group by" in list has been clicked on and list data loaded 2013-10-09

    I have created a JavaScript function to take a url from a list item and turn it into an image. This function works great on a list that doesn't have group by setup. With this script the images will show up after I click the link the second time: $(do

  • Unable to run VMware - Failed to build vmnet 2014-02-03

    I am unable to run vmware and below is the error log as to why. Any idea, though and suggestions are appreciated. Thank you. 2014-02-03T16:32:00.904+08:00| vthread-3| I120: Log for VMware Workstation pid=5707 version=10.0.1 build=build-1379776 option

  • Unable to run .py file in 13.10 2014-03-07

    Unable to run .py file in Ubuntu 13.10 server. It returns this error: Traceback (most recent call last): File "events_send.py", line 2, in <module> import pika ImportError: No module named pika --------------Solutions------------- your mis

  • Unable to run Node.js after installation from source 2014-03-17

    I've tried installing Node.js using the following instructions: cd /opt wget http://nodejs.org/dist/v0.10.26/node-v0.10.26.tar.gz cd node-v0.10.26 ./configure make make install However, once the installation has completed (and with no errors at that)

  • Unable to Run WCF Services (.SVC) on Windows Server 2012 2014-06-20

    I got a server with windows server 2012; however, I was unable to run svc files with it. I was able to run asmx files on it. I decided I wanted to figure out how to run svc files. I tried the the contents of this link : http://msdn.microsoft.com/en-u

  • unable to run the script in linux using plink 2014-08-07

    I'm unable to run a script in linux using plink.exe. I'm using my user x to login and script is under y user, which I need to sudo to y and run it. I was able to at command prompt manually but not through script (for automation). plink.exe -v -t -l u

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.964 (s). 13 q(s)