Is it possible to do the same as this in Eclipse what he is doing in Intellij IDEA? to run the javascript file in console?
To set up Eclipse to run JavaScript files:
In Eclipse, got to Run > External Tools > External Tool Configurations
Double click on Program to open a new configuration and name your new configuration (ex. Node_Config)
Figure out where you have node.js installed. Paste the results in the 'Location' box in Eclipse. (If you haven't installed node, do so here)
Mac: in the command line, run which node.
Windows: in the command line, run where node, or see this for more/different windows advice
Fill in the following:
Working Directory: ${container_loc}
Arguments: ${resource_name}
Click apply, and then close.
Now, in the main Eclipse screen, find the play button with a red toolbox (next to the regular play button). When you have a js file open that you want to run, click this and it will be just like running it from your console using node.
Since Eclipse Neon you can do that. I suggets you that you
download Eclipse Neon and install Eclipse JEE Neon distribution.
install node.js.
With Eclipse JEE Neon, you will benefit with Run As / Node.js Application and even with Debug As / Node.js Application:
He is using WebStorm which is editor for Front-end dev from same company (JetBrains).
Related
The tutor of my video tutorial compiles javascript/react on save with his VS Code editor. Mine dont.
How can I config VS Code to do this?
Remark:
I find solution for typescript "Visual Studio Code - compile on save", but suggested solution does not work for me.
#added information:
the project is created with create.react-app. npm start opens chrome, and compilation errors are then shown in Chrome's DEV-Console, as noted by Shishani . My tutor has the code compiled on VS Code Terminal console. This offers a quick check of the code compilation before I go to webbrowser, to check for errors there, which seems to me much more intimidating with it's long callstacks.
If you create your React project with create-react-app, and then start it with npm start, it compiles automatically on save. Also, if it's not a React project, but just JS/HTML/CSS, you can open your project with the "Live Server" extension in VSCode, and it will update your page every time you save a file in your VSCode workspace.
You can even do like I do, and enable constant autosave, with the AutoSave: afterDelay setting in VSCode (if you dare), and then set the save delay to a super small number (mine is 2ms) so you don't even need to hit save anymore (go to File>Preferences>Settings>[Search "Auto Save"]).
If you have created react project using there official cli tool (create-react-app) then on saving js files it gets re-compile. This is because they are using webpack bundler behind the scene.
If you have created normal html or js files without any such cli tools then it won't work directly, You have to use some kind of bundler with dev-server support to do it.
Parcel! is a great bundler to use without configuration
I was wondering if there was any command from terminal that I could use to match the use in Android Studio of doing file>invalidate cache/restart.
Thanks!
According to a JetBrains employee doing the following will have the same effect:
Shut down Android Studio externally (using kill or similar command), then
Delete system/caches directory (more on that later), and
Start the IDE again.
How to find system/caches directory?
Location of the IDE files depends on the operating system, product and version.
For IntelliJ IDEA follow this guide.
So e.g. for IntelliJ IDEA 2020.3 on macOS you should be looking for ~/Library/Caches/JetBrains/IntelliJIdea2020.3/caches directory
For Android Studio follow the same guide as above but instead of JetBrains in the path use Google
So e.g. for Android Studio 4.2 on macOS you should be looking for ~/Library/Caches/Google/AndroidStudio4.2/caches directory
I am practicing JavaScript and have some stand-alone JavaScript source code that doesn't have to run inside a Web page.
I opened a New -> File in Visual Studio Community 2015 and pasted my JavaScript code in there and saved it to a file on my disk.
I set breakpoints where I wanted to.
Now, I see the Attach button on the top that looks like the Run button but I don't know process what to attach this code to. How do I run this JavaScript code in debug mode?
This question pertains to using Visual Studio as an editing and debugging environment for JavaScript stand-alone sources.
You certainly can do this with Visual Studio. You have two options:
Use the EXE project system to launch and debug your JavaScript file with cscript.exe (Makes full use of the IDE, but requires some setup)
Use the Just-In-Time debugger to attach Visual Studio to cscript.exe, launching Visual Studio, if necessary. (Gets you debugging with no setup, but does not really make use of the IDE)
Option 1: Using the EXE Project System
You can create a project from an EXE so that you can launch the EXE with F5, F10, or F11. From the File menu, choose Open Project and choose %windir%\System32\cscript.exe and click Ignore on the UAC prompt. You should now have a project named cscript.
Now you can either create or open a .js file for editing and setting breakpoints. To debug your .js file, setup the project properties.
Right-click on the project and select Properties to open the project properties page.
Fill in the following parameters:
Arguments: //D file
Debugger Type: Script
Working Directory: Path to the folder containing your .js file
The remaining parameters' default values should be good enough. At this point, you are ready to hit F5 and debug your .js file.
Option 2: Using the JIT Debugger
You can run your .js file with the following command in the command prompt:
cscript //X <your .js file>.
This should automatically bring up the Just-In-Time debugging dialog from which you can choose which Visual Studio installation/instance to launch and attach with (shown below).
Question 1 :
I am using sublime text 3 to develop my site. How do i build my project and run(http://localhost:) as we do in visual studio?
Question 2
If i open the chrome browser from sublime text application for debugging it is just open from my local drive, so javascript files are not get loaded and i am getting blank white screen if i click the script file in the sources tab of dev tools . But the same javascript file get loads fine in the developer tools when i open the site from Visual Studio like http://localhost:.
Sublime text 3 is just an editor so it doesn't have advanced features right out of the box like Visual Studio. You need to set up your own local host in your current working directory. There are many ways to achieve this. You can set up a simple static Python server, if you have Python installed in your machine, with python -m SimpleHTTPServer in your terminal console (or command prompt in windows). You should see this message
Serving HTTP on 0.0.0.0 port 8000 ...
Navigate to browser with url http://localhost:8000/ and you'll see your html along with any javascript/css assets. When you make any changes to your html or asset files, you should restart your server.
I recommend using building tools like gulp or grunt for building projects in general. There are many tutorials online about how to set up automatic server restart and browser syncing using these tools.
I currently have the latest version of Eclipse (Juno) and I have installed ADT with no problem. I have moved on to a web based project and I require support for JavaScript and HTML etc. I installed WTP through the update manager and you can see that all of the required packages appear to be installed:
However, within Eclipse there is very little evidence that anything has been installed. I have read in this jsdt tutorial that I should be able to create web projects such as "Static Web Project" and have text editting support for HTML and JavaScript. However, I see no web project options, HTML or JavaScript file options, no perspective options for HTML or JavaScript, and no support for editing html/javascript files.
Here you can see an html file I attempted to create. Notice the lack of syntax colouring:
Here you can also see all the project creation options that are available to me:
So how should I have installed WTP? Should I not have installed it thought Eclipse's software manager? I would like to do this without having to re-install Eclipse if possible.
This problem seems to exclusively occur in Windows 7. I managed to successfully install the desired software by right clicking on the Eclipse icon, selecting "Run As Administrator" and then re-installing all packages. I did not have to do this in Windows Vista.
If you are experiencing this problem and you are using Windows then follow these steps.
Right click on the Eclipse icon and select Run As Administrator.
Once you have opened your Workspace go to Help -> Install New Software.
Any installed packages that you installed when you did not Run As Administrator should now not appear to be installed. So install them again.
Restart eclipse (normally if you wish) and your desired packages should be installed correctly.