The location of an output .jar file - scala

I have a Scala application made in IntelliJ Idea 12. Although it should be pretty obvious, I didn't find any information about the location of a result (output) .jar file which is generated by IDE.
So what's the location?

Cmd + ; opens Project Structure in IDEA. Choose Artifacts and make one:
There you can see the line Output directory. Then click Build artifacts:
And here is it:

Related

I cannot access MANIFEST.MF, but the jar file has one. How could I access and edit it?

I try to execute a jar file in the command prompt, but I always get the message 'no main manifest attribute, in 2056751-0.0.1-SNAPSHOT-src.jar'. So, I guess I should edit the manifest file. If I check it in the command prompt with the command 'jar tf 2056751-0.0.1-SNAPSHOT-src.jar' I can see that there is a MANIFEST.MF file, still I cannot see it in Eclipse project view.
To partially answer the question asked, IF on Windows (which you didn't say and isn't the only system with a command prompt), a jar file is really a ZIP file underneath and Explorer in all supported versions (>XP/S03) can treat a ZIP file as a directory subtree, so just rename to have the extension .zip and open in explorer, go to META-INF, select MANIFEST.MF and open with plain-text editor of your choice such as notepad. However this may not allow you to edit; if so copy to somewhere writable like the desktop, edit, then copy or move back. Then rename back to .jar
Although the manifest file in a jar can be loaded from an actual file, usually it is created by the jar tool. If you want a jar containing classes to run from the usual file association on Windows use the jar tool with the e option as described in the man page or Windows version on the web and help message. However if your file name is accurate and this is actually a source jar, it will never be runnable by only changing the manifest and you need to learn how Java works.

Custom Makefile With Eclipse CDT

I have a C++ project with 3 .hpp files and 1 .cpp file, and a custom Makefile. The code and the Makefile for this project already existed, so I right clicked in the Project Explorer, and did Import->Existing Code as Makefile Project I named my project and pointed the location to the root dir of the project which contains all of my files. And I selected MinGW GCC as my toolchain because that is the compiler that I have. Then I went to Project->Properties->C/C++ Build and unchecked Generate Makefiles automatically
Then I changed my Build directory by choosing File system and navigating to the root directory of my project which contains all of my files. The Build directory is C:\Users\Ryan\Desktop\School\CSE\CSE 100\pa1-rbridges
Then I changed the Build command to make -f C:\Users\Ryan\Desktop\School\CSE\CSE 100\pa1-rbridges\Makefile bst where bst is a target in my Makefile and my Makefile is at that location. When I click the hammer on the toolbar to build my project, nothing happens. When I try to run my project, I get Launch failed: Binary not found.
I just want my project to use my Makefile and build properly.
I have searched Google and stack overflow for hours trying to figure out how to get this to work and have had no luck. Any help is appreciated.
The solution to these sorts of problems usually begins with breaking them down.
First try and build build from the command line. Does the "make -f ..." work from the command line?
It could be an issue with MinGW not working properly.
It sounds like you have done everything correctly as far as eclipse goes. You may find a clue in the eclipse console window.
Too late for giving an answer. But this is for the other people who end up here.
You need to create a new run configuration in Run->Run Configuration... for your project, and then type a name for the output binary file like Debug\name.exe in 'C/C++ Application' box. The name must be the same as the project name.

How the launcher of eclipse Plugin development project loads\handles the "plugin.xml" file?

I want to figure out how can I put a file in the root folder of the project and use it in run time, there it will be accessible.
The problem that I have by doing that (placing the file in the root folder)-is that by default it means:
It is not in the classpath of the project.
It is not copied to the bin (output) folder.
I can’t see how my modifications of the file will affect the run process.
As I know there is a similar mechanism in eclipse that does the same:
The Plugin development project has a file-"plugin.xml" in the root folder of the project.
When you make a change in the file without building the project or copying it to the bin folder the changes take place when you run it.
example:
add an extension point in ”plugin.xml” and hit “RUN”, it will take place immediately.
Does anybody have an idea how this mechanism works in eclipse?
Edit - for clarification :
I am interested in how the launcher of eclipse Plugin development project loads\handles the "plugin.xml" file.
I assume when you say you want to put a file in a "root folder of the project" you are refering to a plugin that you are developing and then in runtime you want to get access to that file. Please don't vote me down if I did not understand that question correctly but based on my understanding here are some steps to follow:
Open your MANIFEST.MF file /MANIFEST.MF, this will oepn a multipage editor.
Click on the build tab (third from right).
This is where you specify what resources in your plugin you want the builder to include in the plugin at runtime. You will notice that plugin.xml is already checked which is why extensions get updated each time.
Check the resource on this editor page for the resource you want to be able to load and access at runtime. Behind the scenes this is updating your build.xml which the internal builder uses to figure out what sources to build/add when building/exporting the plugin.
One you have done that this is how you can get access to that file, you get the Bundle for your plugin and call the getEntryMethod with the path to your file and then open in inputstream from there you can load it as a File or whatever you want. Code example below: Hope this helps - Duncan
Bundle myBundle = Platform.getBundle("com.mycompany.myplugin.id")
InputStream in = myBundle.getEntry("/myfile.txt").openStream();

Eclipse console link for files not in source

I'm writing an application in Java that does some processing on arbitrary .java files. I'm using Eclipse, and when there's part of a .java file that it doesn't understand, I print out to the System.err stream:
System.err.format("Unable to resolve name %s (%s:%d)\n",
node.getName(), node.filePath(), node.getStartLine());
So it will print out something like this:
Unable to resolve name Foo (C:\project\src\Project\bar.java:63)
And the Eclipse console puts a link on the path and line part of the error. When I try to click on it, it says:
Source not found for C
I assume that's because Eclipse is only looking at source files in the project I'm running, not in the arbitrary .java file I'm processing. Is there any way to make it actually open that file and go to that line?
Unfortunately, the answer is no. Eclipse will only match the files against the resources in the workspace.

System.getProperty("user.dir") anomaly in Eclipse

In my current project settings, I have configured Eclipse to place the compiled .class files in the /bin directory.
My puzzle is that, when I run the application via the IDE and get it to print the current working directory (System.out.println(System.getProperty("user.dir")) I expect the console output to be /bin - instead the value printed is the projectRoot folder (without the /bin suffix).
If I were to navigate to the /bin folder directly, and execute my java class, the current working directory is printed as I expect it to be. What I would like is the Eclipse IDE to behave similarly.
Any ideas as to why I am observing this disparity? I have gone through many project build settings, but cannot seem to find anything that would cause this anomaly.
Kind regards,
Dinuk
In Eclipse, the working directory defaults to the project directory.
You can change this in the run properties
(Project->Properties->Run/DebugSettings->Edit->Arguments tab, at the bottom of the page).
Edit: Actually, the easiest way to get to it is Run->Open Run Dialog->Arguments tab.
It's been a while since I used Eclipse.
From an example of Eclipse Setup New Project
alt text http://apps.sourceforge.net/mediawiki/sprite2d/nfs/project/s/sp/sprite2d/a/ae/EclipseNewProjectDebugArguments.jpg