How to run Luke(Lucene tool)? - lucene

I had downloaded 'Lukeall-3.5.0' on http://code.google.com/p/luke/downloads/list It's a JAR file , but i don't know how let it work? Can somebody show me the detailed steps to run Luke? Thank you!

You can run eg. from command line issuing java -jar lukeall-3.5.0.jar command

If you want the .jar to run on double click then you have to make an association between .jar files and the program that needs to open them, javaw.exe. You can do this manually by following the steps below, or see this site for an automatic tool called Jarfix.
Right click the .jar and go to "Properties"
Click "Change"
Click "Browse..."
Navigate to your Java install folder
In the "bin" folder you should see "javaw"
Select "javaw" and click "Open"
Click "OK"
Click "Apply"

Tried everything including jarfix , javaW commandline but was not running.
Then I downloaded the jar from this link https://code.google.com/archive/p/luke/downloads. there are many .jar and .tgz file. I tried the latest one with "type-executable" label on it. And once it was downloaded somehow the extension got changed to .zip.
1) changed the extension back to .jar
2) right click open with -> Java(this was installed before)
Bingo! Luke opened up!

At first, you need to download and install Java Runtime to your PC.
Then open command prompt: press Windows Key + R, type cmd in the textbox and hit Ok.
Change directory to your jar file locating folder (using cd command), type java -jar .\yourFileName.jar and hit enter.
Hope this will work.

Related

Why can't I open and run a .java file in Intellij, empty configuration

So I was following a lecture of CS61B for an exsercie question, and I've downloaded this .java file from the class's repo, and then when I opened it in IntelliJ, it shows "Project JDK is not defined", so I clicked on it and set it as Java 17.
After that, the interface is as follows:
enter image description here
when I right click on the ArraySet.java file there isn't a "run" option, it shows this:
enter image description here
However, if I simply open a new project and copy and paste the code there, it'll work just fine. It's just that when I open the file directly, it cannot run for some reason. I'm just starting to learn java and IntelliJ, and I've looked everywhere but still am not able to solve it, if someone can help me out on this, it'll be greatly appreciated!
I solved the problem by:
go to file-project settings-project, and change the SDK to 16 or whatever you have in your pc
Goto File->Project Structure->Modules->Choose Your Module->Make sure your folder is marked as "sources"
After that, I can run each configuration cooresponding to the lab

Autoit Recorder not available

From here I downloaded:
SciTE4AutoIt3.exe
SciTE.exe
But AutoIt Recorder is not in the tools menu. Also tried downloading AutoIt Recorder, though I could not. How to get AutoIt Recorder?
As of AutoIt v3.3.14.1 AU3Recorder is not included anymore. The only way is:
Download AutoIt v3.3.14.0.
Copy autoit-v3.3.14.0.zip\install\Extras\Au3Record to {AutoIt-Install-Dir}\Extras\Au3Record.
Start AU3Recorder:
Run {AutoIt-Install-Dir}\Extras\Au3Record\Au3Record.exe.
Or open SciTE and click Tools > AU3Recorder (Alt + F6):
Notes:
Version 3.3.14.0 has AU3Recorder.
Version 3.3.14.2 does not.
Changelog / history does not mention it.
Explained here and here.
It has been removed from the main installer from v3.3.14.1 as it triggers many AV false positives. You can find an old version here:
https://www.autoitscript.com/autoit3/files/archive/autoit/autoit-v3.3.14.0.zip
A little explanation of the rather strange link above:
If we give you a direct link to the file (or the zip file which includes it) the site gets flagged as hosting malware (yes really!) - so what you have is a link to the AutoIt archive page and the name of the zip file you need to download from it.
https://www.autoitscript.com/forum/topic/176009-where-is-au3recordexe/
It is then located in the zip file at:
.\install\Extras\Au3Record
It sounds like you might be looking for the AU3Recorder. You'll find this in one of the following paths (depending on your build), so long as you went with a full installation.
C:\Program Files\AutoIt3\Extras\Au3Record
C:\Program Files (x86)\AutoIt3\Extras\Au3Record
Install AutoIt v3 (This is the latest version as for now)
After installation:
2.1 Click Windows Start icon -> Click "AutoIt v3" -> Click "Browse Extras"
2.2 Extras folder of AutoIt will open in Windows Explorer. Click on "Au3Record" folder -> Double click on "Au3Record.exe"
AU3Record will open
Another way using AutoIt Script Editor(SciTE4AutoIt3.exe):
Download AutoIt Script Editor from https://www.autoitscript.com/site/autoit-script-editor/downloads/
Install it
After installation:
3.1 Open AutoIt Script Editor
3.2. Click Tools menu -> click AU3Recorder from context menu

no response when execute .sh file by double click on fedora20

Today,I installed fedora20 on my computer and then downloaded the Intellij idea13, but when I execute the file by double clicking, there is no response. But it works well in a terminal with ./idea.sh.
Thanks, I need your help!
I'm not a fedora user but the following may help you to understand the problem.
When you double-click an item from the file manager, the default application for that type of file is loaded.
That depends on the configuration for the specific MIME type (which is application/x-sh).
There's a big chance that the default application for .sh files is set to gedit or kwrite depending on the desktop environment. The Intellij Idea installer is binary file and maybe the application is failing to load.
Have you tried right-clicking the file and select the option 'Open in Terminal'? The context menu may also show something like Execute or Launch.

how to use API when there's no binary

Normally when I use an API I download the binary containing the JAR which I then add to the classpath. I want to try Curve API but there's no binary (and hence no JARs in the download). I'm using Eclipse and I have read that you can just add the zip file, but I tried this and it didn't work.
Have you read the README.txt in the zip file with Curve API? Let me quote it:
In the src directory, there is a makejar.bat file. This file will
compile the nested Java files and create a Jar file called Capi.jar.
Compilation requires Java 1.2 or higher. After the Jar file is
created, add it to the classpath. Note: CAPI comes with MESP (Math
Expression String Parser).
If you use Windows Vista or 7 or 8, navigate to the folder with makejar.bat, hold Shift and right-click at an empty spot, and select "Open Command Window Here". It will launch console window with cmd.exe; you should be able to see a line like X:\Full\Path\To\The\Folder> in it.
If you use Windows XP or lower, then press Start button, select Run, and type cmd.exeEnter. Then enter cd "X:\Full\Path\To\The\Folder" (the path should be in quotes), and press Enter. If that folder is on the other drive than your current one (shown at the beginning of the prompt), then also type in the letter of the drive where that folder is located, the symbol :, and press Enter.
So much for opening the command window! Now type in makejar.batEnter. I predict that you will see an awful lot of 'javac' is not recognized as an internal or external command, operable program or batch file. lines. If that's so, then please locate javac.exe on your computer somehow—I suggest using Windows Search. After you locate it, go to the folder where it is; click on the address bar of that folder and copy the path to the buffer. Then switch back to the command window, type set PATH=", right-click and chose "Paste", type in ";%PATH%"Enter. After that, try makejar.batEnter—now it should work. If it does, you may also run makeapi.bat which will generate HTML documentation.

How to configure custom PYTHONPATH with VM and PyCharm?

I am using IntelliJ with the Python plugin and the Remote Interpreter feature to communicate with my Vagrant VM. It sets up the remote interpreter correctly to use my VM's interpreter. But, I use a custom PYTHONPATH in my VM, and I would like IntelliJ to recognize that path and include the modules in that path when developing.
How do I configure IntelliJ/PyCharm's remote interpreter to use a custom PYTHONPATH on the VM?
For PyCharm 5 (or 2016.1), you can:
select Preferences > Project Interpreter
to the right of interpreter selector there is a "..." button, click it
select "more..."
pop up a new "Project Interpreters" window
select the rightest button (named "show paths for the selected interpreter")
pop up a "Interpreter Paths" window
click the "+" buttom > select your desired PYTHONPATH directory (the folder which contains python modules) and click OK
Done! Enjoy it!
Instructions for editing your PYTHONPATH or fixing import resolution problems for code inspection are as follows:
Open Preferences (On a Mac the keyboard short cut is ⌘,).
Look for Project Structure in the sidebar on the left under Project: Your Project Name
Add or remove modules on the right sidebar
EDIT: I have updated this screen shot for PyCharm 4.5
To me the solution was to go to
Run > Edit Configuration > Defaults > Python
then manage the
"Add content roots to PYTHONPATH" and
"Add source root to PYTHONPATH"
checkboxes, as well as setting the "Working directory" field.
If you have set up your own Run/Debug Configurations then you might want to go to
Run > Edit Configuration > Python > [Whatever you called your config]
and edit it there.
My problem was that I wanted to have my whole repository included in my PyCharm 2016.2 project, but only a subfolder was the actual python source code root. I added it as "Source Root" by right clicking the folder then
Mark directory as > Source Root
Then unchecking "Add content roots to PYTHONPATH" and checking "Add source root to PYTHONPATH" in the Run/Debug config menu. I then checked the folder pathing by doing:
import sys
logger.info(sys.path)
This outputed:
[
'/usr/local/my_project_root/my_sources_root',
'/usr/local/my_project_root/my_sources_root',
'/usr/lib/python3.4', '/usr/lib/python3.4/plat-x86_64-linux-gnu',
'/usr/lib/python3.4/lib-dynload',
'/usr/local/lib/python3.4/dist-packages',
'/usr/lib/python3/dist-packages'
]
However, without the fix it said:
[
'/usr/local/my_project_root/my_sources_root',
'/usr/local/my_project_root', <-- NOT WANTED
'/usr/lib/python3.4',
'/usr/lib/python3.4/plat-x86_64-linux-gnu',
'/usr/lib/python3.4/lib-dynload',
'/usr/local/lib/python3.4/dist-packages',
'/usr/lib/python3/dist-packages'
]
Which meant I got the project root folder included. This messed up the pathing for me.
This was done with PyCharm Community 2019.1
Go to Project Settings
Go to Project Structure and right click on the directory you want to add and click "Sources"
This should add the directory to your pythonpath
An update to the correct answer phil provided, for more recent versions of Pycharm (e.g. 2019.2).
Go to File > Settings and find your project, then select Project Interpreter. Now click the button with a cog to the right of the selected project interpreter (used to be a ...).
From the drop-down menu select Show All... and in the dialog that opens click the icon with a folder and two sub-folders.
You are presented with a dialog with the current interpreter paths, click on + to add one more.
In my experience, using a PYTHONPATH variable at all is usually the wrong approach, because it does not play nicely with VENV on windows. PYTHON on loading will prepare the path by prepending PYTHONPATH to the path, which can result in your carefully prepared Venv preferentially fetching global site packages.
Instead of using PYTHON path, include a pythonpath.pth file in the relevant site-packages directory (although beware custom pythons occasionally look for them in different locations, e.g. enthought looks in the same directory as python.exe for its .pth files) with each virtual environment. This will act like a PYTHONPATH only it will be specific to the python installation, so you can have a separate one for each python installation/environment. Pycharm integrates strongly with VENV if you just go to yse the VENV's python as your python installation.
See e.g. this SO question for more details on .pth files....
Latest 12/2019 selections for PYTHONPATH for a given interpreter.
Well you can do this by going to the interpreter's dialogue box. Click on the interpreter that you are using, and underneath it, you should see two tabs, one called Packages, and the other called Path.
Click on Path, and add your VM path to it.
In pycharm 5 follow this,
https://www.jetbrains.com/pycharm/help/configuring-python-interpreter-for-a-project.html
1)Open the Settings dialog box, and click Project Interpreter page.
2)In the Projects pane, choose the desired project.
3)For the selected project, choose SDK from the list of available Python interpreters and virtual environments.
In Intellij v2017.2 you can go to:
run > edit configurations > click ... next to the field 'Environment variables' > click the green + sign
Name= PYTHONPATH
value= your_python_path
Pycharm 2020.3.3 CE ZorinOS(Linux) File>Settings > Project Structure > {select the folder} > Mark as Source(blue folder icon) > Apply
To verify:
import sys
print(sys.path)
Selected path should be listed here.