Error when trying to create test project with vaadin - java

I have installed the Vaadin plugin for Eclipse.
I created a test sample project, now I get the following error:
'E:/Programming/Java/Eclipse/configuration/com.vaadin.integration.eclipse/download/gwt-dev/2.3.0/gwt-dev.jar' in project 'test' cannot be read or is not a valid ZIP file
I even went to the above path and copied the file 'gwt-dev.jar' from there into the libraries folder for this web app, however now I am getting this error:
Archive for required library: 'WebContent/WEB-INF/lib/gwt-dev.jar' in project 'test' cannot be read or is not a valid ZIP file
How do I resolve this error? FYI, I am following the instructions given in the book "Learning Vaadin" by Nicolas Frankel to create a test project.

The error seems to suggest that either you don't have the rights to read the file (which I doubt, since you were able to copy it), or the file is damaged. Check that the md5-signature matches with the one given here. If it doesn't match, the file has been corrupted, and you need to download it again.
http://www.jarvana.com/jarvana/browse/com/google/gwt/gwt-dev/2.3.0/

Related

Android - failed to generate Javadoc with Android Studio Bumblebee

I'm trying to generate Javadoc using latest Android Studio via built in tool:
Tools=>Generate Javadoc...
Whatever I choose from a tool's parameters window there are a lot of errors thrown, regarding to the scope I choose it varies from 50 to 100 and all of them related to Android OS or Dalvik VM. Here are some of them:
error: package android.util does not exist
error: cannot find symbol ... symbol:class Context
error: package android.app does not exist
error: package dalvik.system does not exist
Target Android SDK is 31. Latest Java release installed. Did someone experienced the same issue? What am I doing wrong?
Thanks in advance.
First of all, sorry for my English (I use Google translation).
I just spent 5 days on this error and found a solution that works (for me...).
The latest versions of Android Studio (including Bumblebee) do not generate technical documentation correctly. Here is the procedure to generate it correctly.
In Android Studio, open the project.
First of all, identify all R imports and just replace R with * (example: import com.example.coah.*).
Start by following the classic javadoc generation process:
Tools > Generate JavaDoc
scope : Module
uncheck "Include JDK and library sources in -sourcepath"
Output directory : give the path to the folder that will receive the doc (create this folder beforehand outside the project folder)
Other command line arguments : -encoding utf8 -docencoding utf8 -charset utf8
Make OK. Normally documentation generation failed with "exit code 4".
In the output window, at the very top and on the very right (drag the horizontal scrollbar), click on
"#C:\Users\xxx\AppData\Local\Temp\javadoc_args" :
You get a preview of the contents of the file.
Copy the content and paste it into a text file.
Open the file.
It starts with "-classpath" followed by quotes and a list of file paths. The problem comes from the fact that in this list, the android.jar file is missing, which is normally found in:
C:\Users\xxx\AppData\Local\Android\Sdk\platforms\android-32\android.jar
Check the presence of this file in the user folder (replace xxx by the name of the user) : it may not be android-32 but android-30, or other. Once the right path has been found, it must be added to the classpath, in the first position, just after the quotes and without forgetting to add a ";" at the end to separate it from the next path. Please note that the "" must also be replaced by "/".
Save file.
Open a command window in admin mode and go to the project folder, src\app\main\java folder.
Still in the javadoc output window in Android Studio, copy the first complete command line (which generates the doc) and paste it into the command window, replacing just what is after # with the path to the file text that has just been created (which contains, among other things, the classpath).
It is possible that there are errors and warnings, but the doc is still generated.
Emds
Emds solution helped a lot over here, using it we can solve this problem more easily.
As they said here, main problem is android.jar file is not being included in classpath somehow. So to resolve this we can simply copy path of android.jar (with name too) and then generate a dependency in project for it.
To do this go to File -> Project Structure -> Dependencies
There click on + sign in "All Dependencies" section and select "Jar/AAR Dependency".
Then select "app" for module and in next screen enter android.jar path (path you copied before) and click OK.
Build gradle again and generate Javadoc. It should do the trick.

Youtube Data API Project in a JAR File

I built a java program that is based on the Youtube Data API command line Examples. The program works fine and I now tried to convert the java class into a JAR file in order for me not having to start eclipse each time I want to use the program. To build the jar file I used the Eclipse export function "File->Export->Java->runnable JAR file".
I also chose to extract all required Libraries into the generated JAR.
All seems to work fine up to the point where I execute the program, which even creates the output file I wanted it to create but the JAR file doesn't seem to be able to retrieve data from the Youtube Data API, which means the created file is empty.
Is there anyone who can help me or at least is experiencing silimar issues?
Below I attached two sample Outputs:
This is what I get when executing the code within eclipse which gives me the correct answer
Channel; Subscribercount
Channelname; 12345
This is what I get when executing the JAR file
Channel; Subscribercount
Channelname; null
It seems that the JAR fails to connect to the API
Here I have a console log:
None of these errors occur when executing within eclipse
java.lang.NullPointerException
at java.io.Reader.<init>(Reader.java:78)
at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
at com.google.api.services.samples.youtube.cmdline.Auth.authorize(Auth.java:51)
at com.google.api.services.samples.youtube.cmdline.data.getChannelsVideos.retrieveChannelInfo(getChannelsVideos.java:220)
at com.google.api.services.samples.youtube.cmdline.data.getChannelsVideos.main(getChannelsVideos.java:49)
java.lang.NullPointerException
at java.io.Reader.<init>(Reader.java:78)
at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
at com.google.api.services.samples.youtube.cmdline.Auth.authorize(Auth.java:51)
at com.google.api.services.samples.youtube.cmdline.data.getChannelsVideos.getChannelsVideo(getChannelsVideos.java:92)
at com.google.api.services.samples.youtube.cmdline.data.getChannelsVideos.main(getChannelsVideos.java:50)
Solved it:I copied the client_secrets.json and the youtube. properties into the same folder as the JAR. Obviously it wasn't possible to import these files from within the JAR structure

Open Source Jar file and Failed to load Main-Class manifest

I downloaded an Open Source tool from www.openempi.org used to find duplicate patients. It is referred to as an EMPI tool (Enterprise Master Patient Index). I am a .Net programmer and not a Java programmer, but I have worked with other Java products where I receive a Jar file and run it like a Windows executable.
The zip file contained several Jar files but when I double-click on them I get Failed to load Main-Class manifest from.... After I Googled this term and reading a few posts about it, including several on this site, this seems to indicate that I should have done something different when creating the Jar file, but I didn't create the Jar file. Will I need to use Eclipse or some other tool to get past this, or is there something I'm doing wrong when try to load the Jar? Could it be a Java version issue?
The zip also contained a ./conf folder with several XML, CSV, and SQL files.
Greg
I don't think you want to execute the .jars found in that .zip file. Instead, you should try using the Application.html found after extracting from the openempi-webapp-web-versionhere.war.

modify weka source code in netbeans

i wanna use weka source code (not jar file!)and i download weka-src.jar from this address
http://www.java2s.com/Code/Jar/w/Downloadwekadev379sourcesjar.htm
and i wanna have weka project in netbeanes in windows .i do step by step this site instruction
http://weka.wikispaces.com/Netbeans+6.0+%28weka-src.jar%29
when i extract jar file into src directory in my project,it give me a lot of error
such as:
package java_cup.runtime does not exist
and a lot of other error.
anyone can tell me how can i do that without any error ?? i am working on this problem for a week and i'm so tired.
please help me if you can.
you have to download java-cup.jar file And add this jar to your classpath
if you didn't find java-cup.jar then you can download jflex.jar jflex also contain java-cup classes so you can download jflex.jar from link below
click on this link

where should i place bluecove-2.1.0 folder

I am trying to write a project that communicates with a Bluetooth device and receives information from it. I googled it and from what I understood I had to get a package named 'bluecove' which will contain all I need. I downloaded the jar file, and (in Eclipse) by right-clicking on 'my project>build path>jar file>bluecove', I added the jar file into my project. When I try to run some lines of code, it gives me an error that says that some content is unavailable:
Native Library intelbth_x64 not available
Native Library bluecove_x64 not available
Then I went back to the bluecove website and i saw there another Windows file for download called 'bluecove-2.1.0-sources.tar.gz'
here is a link:
http://code.google.com/p/bluecove/downloads/list
When I downloaded it, there was a folder inside named 'bluecove-2.1.0' which I think I have to copy into one of the system's folders. What should I be doing here?
Thanks
p.s i will need the answer as soon as possible - in the next 9 hours at most, please help me
and again thanks
As stated here (commented by oxc), you need to download the .jar specified: http://snapshot.bluecove.org/distribution/download/2.1.1-SNAPSHOT/2.1.1-SNAPSHOT.62/

Categories