I have a problem with programming in Haxe. Whenever I try to run a code, I get an error:
Please don't add haxe/std to your classpath, instead set HAXE_STD_PATH env var.
I tried to find a solution - according to multiple sites, I'm supposed to change the environment variable HAXE_LIBRARY_PATH to HAXE_STD_PATH and set the value to actual path to the std file in my haxe folder. In my case, there was no such variable among my env vars, so I made HAXE_STD_PATH as a new one - and I still get the same error.
I'm using FlashDevelop and when I try to search for any class that would reference std, I can see in Type Explorer that there is a classpath that leads straight to haxe/std, which should not happen IMO. I looked at classpaths in Properties and the path to std was not listed, so I could not change it.
So problem could be in the classpath or in FlashDevelop settings.
Did anyone have the same problem?
Oh, and BTW I'm using Windows - and yes, restarting did not help.
I removed all: FD including program settings and HaxeToolkit (the whole map).
Then I reinstalled FD, Haxe (using the apps window from FD), Lime and openFL (from command window).
Now I don't get this error anymore.
Related
I have an SCons project (an implementation of the Generic Mapping Tools tutorial at http://gmt.soest.hawaii.edu/doc/latest/GMT_Tutorial.html using SCons rather than shell scripts), and I am using Eclipse Neon to edit the Sconstruct file.
The Sconstruct file starts in quite a standard way (the rest of the file is immaterial to this question).
import os
import collections
env = Environment(ENV = os.environ)
bld = Builder(action = 'ps2pdf $SOURCE $TARGET', \
suffix = '.pdf', \
src_suffix = '.ps')
What is annoying me is that while the build works perfectly using scons, Eclipse keeps marking the Environment and Builder constructions as "Undefined variables".
I installed the SConsolidator plugin, but it makes no difference.
I find the marking of an error that is not an error incredibly annoying.
While I could do something like tell Eclipse to ignore the error, I would prefer something more intelligent, such as adding Scons to the library path. I have tried adding C:\Python27\Lib\site-packages\scons-2.5.1\Scons and C:\Python27\Lib\site-packages\scons-2.5.1\Scons\Scripts to the Python Interpreter Paths (Window → Preferences → PyDev → Interpreters → Python Interpreters → Paths), and using an import directive like from SConscript.SCons import * but it doesn't make a difference.
Try library path:
C:\Python27\Lib\site-packages\scons-2.5.1\
Then
from SCons.Script import *
First thing first - if you know exactly where does your plugin keep it's symbol index(es) make sure that they don't get deleted by whatever the editor/IDE/build think they are doing to "be helpful".
Python plugins for editors easily get confused and you may need you to draw very explicit and detailed picture and train them a bit (by stopping the code in debugger) in order for a scanner/indexer to "wake up" and finally scan and index all symbols.
What I do in VS (with PTVS) is to make one proj for Scons_lib (home at C:\Python27\Lib\site-packages\scons-2.5.0), another for Scons_Scripts (C:\Python27\Scripts\, startup file: scons.py)
and then separate projects for separate scons driven folders/builds. To get editor to immediately recognize building files as Python I add extension .scons (google's convention used in Chrome build, Sconcsript's are ProjName.scons), tell VS that .scons is also Python, rename Sconstruct to Make.scons.
Then I run in debugger, (with -f Make.scons -n of course) as many times as I can :-) trying to place breakpoints in different files form different sub-packages that I know will run. Letting scons throw exceptions for nothing (like missing Sconstuct file) is also file - the goal is to force indexer to go places because it sees that debugger is going there.
After N runs, (and/or K days). PTVS (you can consider it a plugin) all of the sudden starts recognizing all symbols, packages, sub-packages, only can't penetrate things explicitly hidden behind caches.
Gave up trying to determine which events exactly make the scanner/indexer see the light. Probably something like seeing the number of files at "unexpected" paths being in debugger. Most symbols are visible in debugger immediately, except for the files that load first (scons.py and my own file that I exec from scons.py to inject whatever I want before anything else runs.)
Also I keep PYTHONDONTWRITEBYTECODE=1 to make sure that it always has to load actual .py-s
It might potentially help to have a single file that would exercise something form every sub-package, litter it with breakpoints and let it be run a few times.
An "Errors exist in the active configuration of project X. Proceed with launch?" dialog appears while debugging code in Eclipse. Hitting the "Proceed" button results in successful debugging. There are no apparent errors with the launch configuration. A similar Run Configuration does not generate the error.
This is caused by an invalid path somewhere in your Eclipse project settings. There are a couple common sources for this kind of error.
You're working on a shared (version controlled, copied, etc) project where someone has hardcoded a path that doesn't exist on your machine, or uses an environment variable that you've not set.
Sometimes, you can find the offending path by looking at the full list of Error messages. If not, look in your project file.
The Discovery Options in your project properties has 'Automate discovery of paths and symbols' enabled - but the process is generating an error.
If you're using a version of Eclipse that warns you this option is deprecated, uncheck the option to disable it and fix any includes in 'Preprocessor Include Paths' instead. If not. . .try it anyway.
Depending on your path changes, restart Eclipse and try again.
It starts the executable that was built last before you broke the build. That executable will be older then your source files. The reason you were able to debug is because your line numbers did not change for the code you've debugged - e.g. you may try break in main then introduce a compilation error and move main a couple lines below - the debug will highlight the wrong lines when it stops.
there's definitely something wrong with setting up my environment variables.
I had messed around with it when I was trying to do an android app.
now i'm trying to set up netbeans, but it won't build.
when I first tried to build, tool selection came out, and it had looked for cygwin bin files in D: instead of C:, so I manually browsed for each file.
i found g++ make etc. however, I couldn't find gfortran.exe.
now, a message says that it can't find shell, and asks me to install cygwin.
this is what i have in my path:
D:\DAC driver and stuff\;%JAVA_HOME%\bin;
D:\matlab\MATLAB\runtime\win64;
D:\matlab\MATLAB\bin;C:\cygwin64\bin
and yes, cygwin is in C:\cygwin64
this is a picture of everything i have in my environment variables:
http://i567.photobucket.com/albums/ss114/samio_130/cake/pictwoo.png
edit: i think i deleted something from 'path'! should there be something infront of what i currently have??
%JAVA_HOME%\bin is no legit. Everything after it doesn't count, fix is in link.
http://forums.netbeans.org/viewtopic.php?p=151733#151733
Using PyDev with Eclipse Juno, I need to set some environment variables to debug every single of the many scripts in my project. I have found how to set them for a given script but it would be totally impractical to do it for all of them. The only solution I have found consists in adding those variable to the Python interpreter configuration in the Preferences. But then it will be used by all projects, which I don't want.
I thought of creating a script setting those environment variables and then launching Python, and then add it as a new Python interpreter but PyDev does not accept two interpreters with the same actual exe (I guess it checks sys.executable).
The recommended approach is really setting it at the Python interpreter level.
You can use virtualenv ( http://pypi.python.org/pypi/virtualenv ) to create a copy of your interpreter in a different path.
Just to elaborate that #FabioZadrozny's answer meets the need of the OP...
In case it hasn't occurred to you, do this:
From the menu "Window->Preference"
Navigate to "PyDev->Interpreters->Python Interpreter"
Create a new interpreter instance with "New..." button
Name it something like "python-MyProj", but use the same executable you are already using
Now in the "Environment" tab for that interpreter, set up the needed environment variable
Now, see the PyDev project to use THAT interpreter:
Right-click the project to get "Properties..."
Navigate to "PyDev-Interpreter/Grammar"
Select the newly created interpreter instance by name
Now run any python file within the project, and it should "see" the configured environment variable.
By this mechanism, you do have a "project specific setting"... which, again, for the reasons #FabioZadrozny pointed out, need to be set at the interpreter level.
Java problems
I am a student of Java. I managed to write about 15 Java programs so far and get them working on the PC. But I have not yet written a init() method like my latest assignment requires in order to initialize some instance variables. The compiler tells me that my init() method is attempting to override the final init() method in the acm.program. Isn’t that what an init() method is supposed to do? After exhausting all avenues on PC for the last week, I thought maybe it is an Eclipse problem on the PC. All the example code in the Java documentation shows little Mac windows. So I thought I would try moving my code to a Mac running Lion OS 10.7.2.
Switching to MAC environment.
The Mac claims to have Java installed but I think it’s just the run time environment, not a development environment. All I could find for applications is the Java VisualVM, which I assume is the virtual machine so there is no java development software. So… I downloaded Eclipse for Mac from Stanford’s website and got Eclipse IDE for Java Developers Version: Helios Service Release 2 and tried to run a simple program which included an import statement.
The import acm.program.*; statement is giving the compiler a problem: "acm cannot be resolved”. After researching this I think the problem is I have not downloaded the acm.jar archive and added that to my build path. Why this isn’t already done for me, as part of Eclipse I have no clue. I guess everything has to be difficult.
So I downloaded the acm.jar archive and it’s sitting in my download folder. I tried double clicking it and thankfully the mac won’t execute it. I tried dragging it into my source folder in Eclipse and then adding it to the build path. Once in the build path, Eclipse tells me the jar is missing. So I removed it from the build path and instead from inside Eclipse went to Properties/Java Build Path/Libraries/add External JARS… and navigated to my downloads folder where the acm.jar folder is to select the JAR. However, Eclipse seems to be looking for a .jar;.zip file, which there are none because my Mac helpfully already unzipped the folder. So I changed the open window to look for all files (.) and now I see individual .java files that are too numerous to add to the build path individually.
So back to the PC and download the acm.jar zip file and copy it over to the Mac in unzipped form and again add it to the build path as a zip file. This resolved the compiler error and my simple program executed on the Mac!
Next I will try my program with the init() method to see if that now works. Nope. Same problem on the Mac. This init method causes the following error: Multiple markers at this line
overrides acm.program.Program.init
Cannot override the final method from
Program
public void init() {
canvas = new HangmanCanvas();
add(canvas);
}
Does it have to be this hard or am I missing something?
Generally Macs have the whole JDK installed. Eclipse is nice, though.
This "acm" package isn't installed because it's not any kind of standard thing; this is like asking why your refrigerator doesn't come with asparagus already in it.
That last dialog was the right one; you need the original jar file. Try again, right-click and "Save As..." the link to save the file from your browser.
See 3. I find it particularly funny that anybody would use a Windows computer to make up for shortcomings of a Mac; in reality the Mac is infinitely more flexible and more powerful.
If you got a message that complains you're trying to override a final method, then you are indeed trying to do something wrong; final actually means "You're not allowed to override this." Perhaps you didn't fully understand the instructions for the assignment.
It gets better, I promise. Just be sure to use each of these annoyances as a learning experience.
There is no reasons why Java for the Mac would be any better than Java for the PC. The language and tools should work the same ... assuming that you are using the same versions of the language and similar versions of the tools.
Your problem with init is nothing to do with PCs versus Macs. So don't waste your time switching platforms to try to fix it. You need to figure out what the
On the face of is, the compiler / IDE is telling you the truth. Java won't let you override a final method. In fact the whole point of declaring a method to be final is to prevent overloading.
However, this does not make sense. According to the documentation I found here, the acm.program.Program.init() method is designed to be overridden. So why won't it let you?
I suspect that the cause of your problems is that you've downloaded or been given a copy of the JAR file that someone has messed around with. Someone has changes the method to be final (for some reason best kown to themselves), compiled it and put it up for people to download. Google is not always your friend ...
So, what I suggest you do is review all of the handouts and the files that were provided to find either the copy of the JAR that is provided, or the instructions on WHERE to download it from. Then replace the copy of the JAR you are currently using with the recommended one.
Why this isn’t already done for me, as part of Eclipse I have no clue. I guess everything has to be difficult.
How is Eclipse supposed to know what this "acm" stuff is? Which version you require? Where to download it from?