I'm an economist and data scientist trying to get into "formal" coding. For that I started taking the Princeton's Intro to CS from Coursera, thaught in Java. I had set up VS to write the code and everything went fine until the current chapter, which requires using libraries.
By creating a project and setting my .java there I copied the stdlib.lib library into the "lib" folder of my project I'm able to run the file from the Visual Studio. However, when I try to run the .java using javac Triangle.java from the console this is the output:
Can't find StDdraw library
Please note that on the left the stdlib library that contains the StDdraw class is loaded.
Related
I'm new to Java coding and to Android studio. After selecting to create a new project, I select the option "Empty Activity" and then Java as the language. I essentially follow all the "newby" steps, as described, say, here in the first answer: Starting New Project in Android Studio
When I press finish, I get the following screen:
EDIT: The directory in which Android studio is installed is contained within a User folder that contains a space (it can't be renamed). This might be a source of problems (I don't know). I also tried saving the projects in folder C, not in a subfolder contained within C, but this solves nothing (Android Studio was not installed in said folder).
I've read that upon successfully creating such a new project, I should get a screen with some basic code on it. I get nothing like this. I also read that Android studio should create an xml file and a .java file. The .java file is missing.
What's going wrong here? Where can I start writing code? How can I fix this?
Its look like your project is not created properly, If you create new project in android studio it will look like as below SS.
You can also check your project folder and file from finder option like below SS.
After that you can see below structure for your project
You don't found anything like above SS please try to create another project but this time change your location for your project.
One more thing in Android Kotlin is more preferable over JAVA so also check with Kotlin for development.
Good Luck!!.
So,
I have been coding Java last semester (college) and we've always done it in Notepad++ , compile and execute by CMD (very simple programs though) and now I want to start codding in Eclipse, since I heard that it saves you a lot of time in syntax and gives you a heads up on typos and errors (Also I'm tired of compiling and executing by console). But the thing is that I usually have my code into two folders (model and interface) and use the
package modelo;
package interfaz;
And now I execute eclipse and open these files, but it doesn't seem to work, I mean the code shows up and I can edit, but it wont show help or even let me execute the code. I know it must be a very noobie question but I can't seem to make it work.
Update:
This is what i get when i import my "project"
This is the error
The project is not configured as Java project:
Create a Java project via File > Other...: Java > Java Project
Copy the content of the src folder into the src folder of the new project
In the new project, open the class that contains the main method and click the Run button
maybe eclipse didn't figure out which main you want to run.
try right click on Menu.java -> run as -> 1 Java Application
You need to create a project in Eclipse first, then add packages and classes in that project, make sure that the JDK in classpath is configured correctly
i started to learn android program ,and i curious to see the code of the classes/
for example the class of import android.app.Activity.
how can i see the source code of the packages in eclipse?
You can attach source code to libraries. yourProject / Properties / Java Build Path / Libraries / yourLibrary / Source attachment, and then enter the folder or zip file containing the source code (which you need to download separately).
If you only have the object code (.class files), then you need to learn to read ByteCode (which Eclipse shows pretty nicely) or use a Java ByteCode disassembler.
As in android sdk what we get is a compiled jar file which contains all the classes.
So in eclipse you can't read the source, but you may use, The official online version to read the source code of classes:
http://developer.android.com/reference/packages.html
[In eclipse although by CTRL+Click on import may show you a bit about the class, although that won't be easy to understand :)]
So I want to view PDFs in my app and I've come across APV PDF, but I just can't understand the instructions on how to use it
http://code.google.com/p/apv/wiki/Building
Why isn't it a jar library to download?
Why do I have to compile some .so files, why can't I download them?
I browsed the source and there is a demo application here:
http://code.google.com/p/apv/source/browse/#hg%2Fpdfview
I copied that into eclipse as an Android project and it compiles but I get an error when I run and select a PDF in the compiled app
java.lang.UnsatisfiedLinkError: parseFile
I understand this has something to do with what I've asked above, so hopefully I'll get some answers.
This probably has something to do with the NDK which I have no experience with.
My mind has been expanded!
1) You can't have a Jar as this is C code, so it is going to run in the NDK therefore the equivalent is a .so file.
2) I don't know why they don't let you just download an .so file (as well as having the source), but it seems this project is just a starter project i.e. you are expected to take the source and modify it. Therefore if you just had a .so file you could not do this. Each time you change the source code in /jni/pdfview2 you have to rerun the script build-native.sh and that will recreate your library (.so) files for you!
I was getting the UnsatisfiedLinkError as the .so library I was using was built against a different version of the code than that which the Java file was trying to reference. Therefore my link was un-satisfied!
Hazar!
I have seen a similar problem here for example , but i am not trying to acces to Java SE features..
I have a .jar file with the code of a bluetooth functionality.. I try to make a .jar package that works with Blackberry and Windows.. In both cases i use the javax.bluetooth.BluetoothConnectionException class. This class comes in the Blackberry SDK and in the BlueCove package to use Bluetooth in Windows... so the BlueCove package is included in the jar file..
When i try to use the .jar file with the Blackberry, i have the error mentioned in the title: Error!: Duplicate definition for 'javax.bluetooth.BluetoothConnectionException'.. My problem here is that i want to use a feature that comes in the Standard SDK from RIM, but there is another class with the same name and in the same package in the .jar file, and therefore, i get this error... Is there some way to make the BlackBerry application to look for this class in its own SDK instead of the .jar file?
I think that i cannot / should not modify the package of any of the classes. Any ideas here? I would appreciate any.
Thanks
PS: I use the Eclipse plug-in for Blackberrry, in case that is usefull.
I would get the source code of BlueCove project, and open it in a IDE, for example Netbeans, and refactor package names. Change (refactor) package names to avoid name conflict.
After that include refactored BlueCove sources or compiled jar file to your BlackBerry project.