I followed all the instruction given on stackflow, but unfortunately not able to generate doc file for my android project.
If I am not mentioning class path on last step of java doc generation, then getting "Android reference" error.
And if using it, then getting "javadoc: error - The -classpath option may be specified no more than once." error.
Using classpath:
-classpath "D:\Android 4.2 SDK\android_sdk\platforms\android-15\android.jar"
Am I using correct class path command ?
Please help me out.
Environment used:
Eclipse indigo
If you use Intellij IDEA go to Tools - Generate JavaDoc... Specify all the settings and set params: -bootclasspath [path]\android-sdk\platforms\android-{version}\android.jar -encoding UTF-8 -docencoding utf-8 -charset utf-8
More information is in this post.
Have You followed these steps (from www.mtholyoke.edu)? This works on my Project....if not and You get an error, please write here which error You get.
Project -> Generate Javadoc
In the "Javadoc command" field - browse to find javadoc.exe
• On the computers in the Clapp CS lab that is C:\JBuilderX\jdk1.4\bin\javadoc.exe
• On other computers it would be \bin\javadoc.exe
Check the box next to the project/package/file for which you are creating the javadoc
In the "Destination" field browse to find the desired destination (for example, the root directory of the current project).
Leave everything else as it is.
Click "Finish"
Javadoc should be in the destination folder. Open "index.html"
EDIT
I found a thread here in Stackoverflow with a lot of tipps, try this:
Javadoc in Eclipse failing to recognize packages
NEXT EDIT
It is only a possibility, but You specified Your classpath as:
"D:\Android 4.2 SDK\android_sdk\platforms\android-15\android.jar"
I know that eclipse got some problems with spaces inside a path. So the first part "Android 4.2 SDK" has to be specified without spaces, maybe here is the issue. But be aware, if You change this path, You have to set everywhere the new path where You have definded it.
I'm using the command line. I have also updated to Eclipse Kepler. It seems to execute javadoc differently? I'm investigating. But try this:
read the javadoc manual. It's confusing and doesn't tell you what to do, but, here's an example that should get you going.
Create a file called "options"
Add to the file this:
-d target-bin
-stylesheetfile style.css
-use
-splitindex
-windowtitle 'My Project Name Class Specification'
-doctitle 'My Project Name Class Specification'
-header '<b>My Project Name</b><br><font size="-1">0.1.5-alpha</font>'
-bottom 'Copyright 2014 My Company or Myself. All rights reserved.'
-group "Group Of Packages" "com.mypackage.*"
-overview overview.html
-exclude 'android'
-subpackages 'com.mypackage:android'
-charset utf-8
-encoding UTF8
-quiet
-sourcepath ../myProject/src;..\..\..\android-sdks\sources\android-19
Then on the command line type:
javadoc #options
Now, in Kepler, the "Generate Javadoc" dialog box says "What is the javadoc command line"...I suspect I'll have to type something like this. But don't know.
Hopefully this quick example will give you a start on how to get it done for your purposes.
By the way, I created a generic Eclipse project called "javadoc" in my Workspace so I could manage the files.
Related
We're upgrading to Delphi 11.1 from 10.4.
We have a few scripts which build and deploy Android projects. They assemble an msbuild command that looked like this:
msbuild someproject.dproj /v:q /p:Platform=Android /t:Build;Deploy /p:Config=Release /p:BT_BuildType=AppStore
With 11.1, this throws an error message:
C:\Program Files (x86)\Embarcadero\Studio\22.0\bin\CodeGear.Common.Targets(940,7): error MSB4036: The "XmlPeek" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Windows\Microsoft.NET\Framework\v2.0.50727" directory. [someproject.dproj]
Now, C:\Program Files (x86)\Embarcadero\Studio\22.0\bin\rsvars.bat, which is used by all of our build scripts, explicitly sets the .NET framework as below:
#SET FrameworkDir=C:\Windows\Microsoft.NET\Framework\v4.0.30319
#SET FrameworkVersion=v4.5
After some research, I hit on the idea of adding a toolsversion parameter to the msbuild command as below, and this worked:
msbuild someproject.dproj /v:q /p:Platform=Android /t:Build;Deploy /p:Config=Release /p:BT_BuildType=AppStore /toolsversion:4.0
This is all well and good, but I would prefer not to hard-code the toolsversion number in the script(s).
Is there a way I can programmatically obtain the correct value of the toolsversion that Delphi itself is using when it generates builds, etc.?
I assume that just finding the highest .NET version installed will not suffice (and even then, one has to "translate" that to a toolsversion). It has to marry up with whatever Delphi is doing (e.g., in the CodeGear.Common.Targets file referenced in the original error message).
This is a bug in Delphi 11.1 that has at least 3 bug reports: RSP-37855, RSP-38466, and RSP-38467.
You can add /tv:4.0 to your MSBuild command line, or modify the first line in the .dproj file to:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0" DefaultTargets="Build">
Assuming that rsvars.bat has been run,
FOR %%v IN ("%frameworkdir%") DO SET "toolsversion=%%~nv"
ECHO msbuild ...blah... /toolsversion:%toolsversion:~1%
The variable frameworkdir will be set by rsvars.bat. The for command parses its value (eg. C:\Windows\Microsoft.NET\Framework\v4.0.30319 as though it is a filename, and picks v4.0 as the "filename" (~n modifier [filename] of the metavariable %%v)
Then use the value assigned to toolsversion, starting at character 1 (where the first character is "character 0")
--- Given more info in comment
FOR %%v IN ("%frameworkdir%") DO ECHO %%~nxv|FINDSTR /R ".*\..*\.">nul&IF ERRORLEVEL 1 (SET "toolsversion=%%~nxv") ELSE SET "toolsversion=%%~nv"
Oh ye of little faith :)
i am following this tutorial here to use Tesseract libs for android. and in step(b) in the link posted, it says: b.export TESSERACT_PATH=${PWD}/external/tesseract-3.01
and in cygwin i wrote the following:
dm#me /cygdrive/e/Data/private/Fr/OCR/libs/tess-two-
master/tess-two-master/tess-two
but when i execute it i receive the belwo error:
$ export C:\Program Files (x86)\Tesseract-OCR=${PWD}\external\tesseract-3.01
-bash: syntax error near unexpected token `('
please let me know how to fix it, as i am a beginner to cygwin.
update:
i tried ezrepotein4 answer, and now it gives me "not a valid identifier". please , let me know what is "external\tesseract-3.01", i do not have these files/folders...and what is PWD. thanks
In this tutorial author uses few linux commands:
cd which changes directory - it is an equevalent of windows dir
export which sets environment variable
Before exporting any variable you should change directory to your project dir, because all $PWD strings in further commands will be replaced by your current directory.
This tutorial assumes that you compiled tesseract and leptonica and you keep them in project-dir/tess-two/external directory as tesseract-3.01 and leptonica-1.68. Source code for those libraries are in tess-two/jni directory in repository as stated in README.md https://github.com/rmtheis/tess-two/blob/master/README.md
Code which you are trying yo execute is incorrect both syntactically and semantically. It is incorrect syntactically because you all spaces are treated as separators between arguments. Semantically you are trying to set variable C:\Program Files (x86)\Tesseract-OCR to value of ${PWD}\external\tesseract-3.01. Instead you should set TESSERACT_PATH variable.
To do this try command TESSERACT_PATH=${PWD}/external/tesseract-3.01 as stated in tutorial. This means that you are setting variable TESSERACT_PATH to folder external/tesseract-3.01 in your current dir.
To further inspect a value of this variable type: echo $TESSERACT_PATH.
For some reason I cannot generate a javadoc with Android Studio, after like 96 warnings it gives me this:
95 warnings
java.lang.NullPointerException
at com.sun.tools.javadoc.TypeMaker.getType(TypeMaker.java:83)
at com.sun.tools.javadoc.TypeMaker.getType(TypeMaker.java:44)
at com.sun.tools.javadoc.ClassDocImpl.superclassType(ClassDocImpl.java:496)
at com.sun.tools.doclets.internal.toolkit.util.Util.getAllInterfaces(Util.java:453)
at com.sun.tools.doclets.internal.toolkit.util.Util.getAllInterfaces(Util.java:491)
at com.sun.tools.doclets.internal.toolkit.util.ClassTree.processType(ClassTree.java:194)
at com.sun.tools.doclets.internal.toolkit.util.ClassTree.buildTree(ClassTree.java:146)
at com.sun.tools.doclets.internal.toolkit.util.ClassTree.<init>(ClassTree.java:91)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.startGeneration(AbstractDoclet.java:123)
at com.sun.tools.doclets.internal.toolkit.AbstractDoclet.start(AbstractDoclet.java:83)
at com.sun.tools.doclets.formats.html.HtmlDoclet.start(HtmlDoclet.java:63)
at com.sun.tools.doclets.standard.Standard.start(Standard.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:280)
at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:160)
at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:397)
at com.sun.tools.javadoc.Start.begin(Start.java:167)
at com.sun.tools.javadoc.Main.execute(Main.java:59)
at com.sun.tools.javadoc.Main.main(Main.java:49)
javadoc exited with exit code 1
Is there a way to create the javadoc in android studio? If not, how could i create one, I need to give it with my project.
A combination of the two answers given here worked well for me. Though the docs generate fine, I still get 900 warnings and 140 errors BUT they're all related to the android packages. This is just the given solutions combined and explained a bit for people who aren't familiar with Android Studio or command line interfaces.
HOW TO GENERATE JAVADOC IN ANDROID STUDIO
Open Android Studio > Tools > Generate Javadoc
Select the scope, usually the whole project
Check include jdk and library sources
Specify the output directory. A load of files will be dumped here, so I recommend creating a new folder.
Select which methods you want to expose. Usually protected is desirable unless it has to look impressive for school.
The "tricky" part, "Other command line arguments". Under the pretty GUI, there's a direct call to the javadoc command, which runs the javadoc generator. The command line uses a structure like this: program_name [-flag] argument [-flag] argument, which as you can guess calls the program with certain optional behaviours, passing in what those should be.
So by specifying the following under "Other command line arguments"
-encoding utf-8 -bootclasspath /path/to/sdk/platforms/android-##/android.jar followed by clicking OK
you're really calling the javadoc program with these flags and arguments. These two flags allow the javadoc program to ignore unicode characters and find the android.jar though it seems that everything marked with # is read as a number and the android javadocs are filled with them.
I urge you to read through the warnings for your classes despite the seemingly large amount of spam, as javadoc will tell you when you've forgotten things like empty #return statements.
Adding the following line on "other command line arguments" fixed the errors:
-bootclasspath /path/to/sdk/platforms/android-##/android.jar
I don't think this issue is specific to Android Studio. I'm guessing it will happen anytime you've got Unicode characters in your JavaDoc comments.
Try using the following command:
javadoc -encoding utf-8
Alternatively, you can just use Unicode escapes (e.g. \u0000) instead of including Unicode characters directly.
In Eclipse, you can add extras to the JavaDoc command:
Project -> Generate Javadoc -> Next -> on the last page, in Extra Javadoc options write:
-encoding UTF-8
If you have a static final string variable containing the escaped unicode, you can try referencing the value of the string in the doc. Android Studio was able to resolve the unicode in the sidebar documentation for me. I don't know if this will work if you're trying to generate the doc from the command line though.
private static final String UNICODE_VALUE = "\u251c";//or whatever string
/**
* {#value #UNICODE_VALUE}
*/
//whatever you want to document
I know this may be late, but it's worth the effort. you may add this to the gradle.build file
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')
}
I'm trying out a sample JNI program but am unable to get the javah
tool to work. I have 1 source file, Nativejni.java in C:\Workspace\VideoRecorder\src\org\ccb\wifo\video\Nativejni.java.
org.ccb.wifo.video is the name of the package.I have compiled and got a class file in the src directory.And for generating header file I have tried like below
C:\Workaspace\VideoRecorder\bin>javah -jni org.ccb.wifo.video.Nativejni
But I got an error like .
**error: cannot access org.ccb.wifo.video.Nativejni
class file for org.ccb.wifo.video.Nativejni not found
javadoc: error - Class org.ccb.wifo.video.Nativejni not found.
Error: No classes were specified on the command line. Try -help.**
I have googled a lot and tried the solutions found there. But no use.
Please help me.
There could be a lot of reasons for it. Mainly to do with -classpath. If you don't want to fiddle around with changing of classpath manually, you can do it while compiling in the console.
javah -d /dir/where/output/generated -classpath ;<absolute path to the /bin/classes> <package name>
1) Remember that ";" is important as it appends the path provided by you to the already existing one.
2) Be careful with slashes (Linux = / and for Windows = ).
3)I suppose you understand what I mean by absolute path.
I wasted like 3 hours on this. It has been due to some sort of java directory issues or what. Anyways this is how i did it.
Open command line. Go to the exact folder where .java class is located. go there and execute command
javac HelloWorld.java
then go back to the folder containing the complete package. There type this statement for generating the header file from the class file. The directory must be like in my case the whole package was in Java directory file so i went back there and typed the following command.
javah -jni com.example.aliabbasjaffri.temporary.HelloWorld
Voila, Header file at your service.
You have to enter classpath, Please try this,
Javah - jni -classpath C:\Workspace\VideoRecorder\src\ org.ccb.wifo.video.Nativejni
I'm trying to use Ensime to work with adnroid project generated with g8 (https://github.com/philcali/android-plugin). Followed this question I added the android.jar to my .ensime file. Here is it:
(:project-package "org.test"
:use-sbt t
:compile-jars ("~/_dev/_android/android-sdk-linux_x86/platforms/android-8/android.jar"))
Also i've got an exported ANDROID_SDK_HOME variable in my ~/.bashrc file.
But when i'm trying to start the ensime i'm getting this error:
java.lang.RuntimeException: Android SDK not found. You might need to set ANDROID_SDK_HOME or ANDROID_SDK_ROOT or ANDROID_HOME
at scala.Predef$.error(Predef.scala:58)
at AndroidPath$$anonfun$settings$8$$anonfun$apply$1.apply(AndroidPath.scala:21)
at AndroidPath$$anonfun$settings$8$$anonfun$apply$1.apply(AndroidPath.scala:21)
at scala.Option.getOrElse(Option.scala:104)
at AndroidPath$$anonfun$settings$8.apply(AndroidPath.scala:21)
at AndroidPath$$anonfun$settings$8.apply(AndroidPath.scala:20)
at sbt.Scoped$Apply$$anonfun$single$1.apply(Structure.scala:444)
at sbt.Scoped$Apply$$anonfun$single$1.apply(Structure.scala:444)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:44)
at sbt.Init$Apply.get(Settings.scala:223)
at sbt.Init$class.sbt$Init$$applySetting(Settings.scala:144)
at sbt.Init$$anonfun$compile$1$$anonfun$3$$anonfun$apply$2.apply(Settings.scala:100)
at sbt.Init$$anonfun$compile$1$$anonfun$3$$anonfun$apply$2.apply(Settings.scala:100)
at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:123)
at scala.collection.immutable.List.foldLeft(List.scala:45)
at scala.collection.TraversableOnce$class.$div$colon(TraversableOnce.scala:139)
at scala.collection.immutable.List.$div$colon(List.scala:45)
at sbt.Init$$anonfun$compile$1$$anonfun$3.apply(Settings.scala:100)
at sbt.Init$$anonfun$compile$1$$anonfun$3.apply(Settings.scala:100)
at sbt.Init$$anonfun$sbt$Init$$applyInits$1.apply(Settings.scala:140)
at sbt.Init$$anonfun$sbt$Init$$applyInits$1.apply(Settings.scala:140)
at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:123)
at scala.collection.immutable.List.foldLeft(List.scala:45)
at scala.collection.TraversableOnce$class.$div$colon(TraversableOnce.scala:139)
at scala.collection.immutable.List.$div$colon(List.scala:45)
at sbt.Init$class.sbt$Init$$applyInits(Settings.scala:140)
at sbt.Init$class.make(Settings.scala:92)
at sbt.Project$.make(Project.scala:102)
at sbt.Project$$anonfun$makeSettings$1.apply(Project.scala:177)
at sbt.Project$$anonfun$makeSettings$1.apply(Project.scala:177)
at sbt.Project$.translateCyclic(Project.scala:218)
at sbt.Project$.makeSettings(Project.scala:177)
at sbt.Load$.apply(Load.scala:120)
at sbt.Load$.defaultLoad(Load.scala:36)
at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:371)
at sbt.BuiltinCommands$$anonfun$loadProjectImpl$2.apply(Main.scala:368)
at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:61)
at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply$2.apply(Command.scala:61)
at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:63)
at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:63)
at sbt.Command$.process(Command.scala:91)
at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(Main.scala:66)
at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(Main.scala:66)
at sbt.State$$anon$1.process(State.scala:59)
at sbt.MainLoop$$anonfun$next$1.apply(Main.scala:66)
at sbt.MainLoop$$anonfun$next$1.apply(Main.scala:66)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:13)
at sbt.MainLoop$.next(Main.scala:66)
at sbt.MainLoop$.run(Main.scala:61)
at sbt.xMain.run(Main.scala:33)
at xsbt.boot.Launch$.run(Launch.scala:54)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:43)
at xsbt.boot.Launch$.launch(Launch.scala:68)
at xsbt.boot.Launch$.apply(Launch.scala:14)
at xsbt.boot.Boot$.runImpl(Boot.scala:24)
at xsbt.boot.Boot$.main(Boot.scala:15)
at xsbt.boot.Boot.main(Boot.scala)
I couldn't understand the reason why it happens. Does anybody have some thoughts about it? Thanks.
The solution is found! The answer is here: https://github.com/aemoncannon/ensime/issues/184#issuecomment-2038002:
The environment variables in .bashrc are only valid for programs
running in or are started from bash, otherwise you'll need .profile.
If you're using emacs: You could use M-x getenv to see if emacs can
see the environment variable. Use a (setenv "ANDROID_SDK_HOME"
"~/_dev/_android/android-sdk-linux_x86/") in your .emacs to set it for
every emacs session. But you probably already know this so I don't
know if this is of any help at all. Emacs sometimes seems to be tricky
to set up concerning environment vars.
Thanks to zilti!