I'm working on a rather large project in java thus the need for javadocs.
I'm using java 1.8.0_332.
My problem is that when I try to generate the javadoc with Intelij Idea Community 2022.2.
It tries to use the --source-path flag when generating witch fails because it isn't yet defined in java 1.8.
Is there a way to force Idea to list the files separately if not is there a way to give javadoc the specified files manually. (yes I know at this point I should be using a build system to automate such things but I'm not the one making the calls on what I can use)
I've tried the methods in this question to no avail.
As in the question mentioned above I've tried to generate the javadocs via the Tools -> Generate JavaDoc panel, witch returns this:
1 error
javadoc: error - invalid flag: --source-path
"javadoc" finished with exit code 1
This error is due to me using java 1.8.0_332. I cannot change this in the main code compilation due to my spec regulations. Nor does the project have any build system. Again due to the spec this would be rather hard to push through. (I'm aware that a larger scale project should have one)
My second attempt was to use a custom scope where all my .java files are present.
This resulted in the same output as above.
I've ran out of elegant solutions at this point.
As the project is rather large and old code handed down to me I wouldn't want to manually list these .java files (though with scripting that could be a solution).
Are there any elegant solutions that I'm missing?
Related
I have successfully followed the instructions from amura.cxg's Stackoverflow question/answer on how to setup Eclipse for ANTLR4 (Thanks amura.cxg!).
It works well, my .g4 grammar files are getting run through ANTLR4 fine. One downside is the ANTLR4 plug in has no option for setting the -package argument to the command line, but -listener/-visitor options are present.
My issue is... now I have these cool *.java artifacts as a result of using the plug-in. I want Eclipse to either build them in place, and allow my *.java code at the bottom of the screen to find the *.class files, or have Eclipse auto move/copy them to be sources in the *.java projects below (I don't care as long as it's automated and works).
I'm looking for a way to do this. I would hope I don't have to setup and install MAVEN.
Currently my *.java code which is dependent on the BaseListener.java classes won't build because the classes are not getting built.
Thanks!
I started with Linked resources and had some success, but it still wasn't perfect.
I found this information from
this StackOverFlow Questionwith an answer from srinivasan.
This is the screenshot to create linked resources. This was the method I wanted to understand.
There are two ways to create linked resources. One "add a Folder", this method I tried first, and was not exactly what I wanted, as it created an extra layer and forced the naming of the lcoal folder. By using the Properties tab, I was able to create a local alias for the resource. I think this will ultimately be the solution.
I'm still testing it, but I wanted to post my findings so far in case I get too busy to document my progress in learning later.
:)
i am trying to port a build from Eclipse to use "standalone" ant, there are a lot of linked files/folders and also some cycle references(If i export via Eclipse it is working).
I was trying to find a way to make the javac ignore if a java file was not found.
Is this even possible with ant?
And if not, is there any chance i could be able to get a working build perhaps with an other build tool?
thanks in advance
I was trying to find a way to make the javac ignore if a java file was not found.
Don't. Instead, make sure you supply all the code you need.
What would you expect the compiler to do if you start using a type which it knows nothing about? Java just isn't designed to cope with the situation.
If Eclipse can build the code without errors, then everything should be available - you should track down every missing file rather than trying to ignore them.
For starters, and granted being new to java development, I have a few questions.
I am using the Eclipse IDE, and have downloaded a zip file *com.alvazan.orm library.
Initializing a Java Project from an Existing Ant Buildfile, and using the build.xml file, I get TONS of com.alvazan.orm.api packages, each containing various .java files/test cases and and equal number of .Jar files containing even more packages, etc.
So, right off the bat, I notice several warnings, Java Build Problems
Classpath variable 'JRE_LIB' in project 'std_buildfile' is deprecated: Use the JRE System Library instead
Is this something that will effect the running and debugging of test cases?
Additionally, I have run into Java Problems, upon initial build:
The method translateToColumnImpl(Collection, RowToPersist, Collection) from the type DboColumnToManyMeta is never used locally
The value of the local variable existing is not used
The value of the local variable toBeAdded is not used
The value of the local variable toBeRemoved is not used
While these are currently only errors, since attempting to run various test cases and coming up with even more warnings and errors, I am concerned the looming warnings maybe affecting the outcome.
Please advise if this something which needs addressing or if is generally a common occurrence.
I would be glad to post more information of necessary, just let me know what is necessary.
These "warnings" not errors are a common occurence. You only have issues when you see the red errors. Eclipse likes to tell you about potential problems like generally unused fields should be deleted. Many times fields are not deleted because they are about to be used. None of the warnings ever affect your ability to run or debug the programs though. ONLY the red errors will affect your run AND when you try to run in eclipse with red warnings eclipse will even prompt you saying "this doesn't even compile, are you sure you still want to run" and generally you should not run when you have red errors.
I'm currently creating a personal (maybe public) java terminal. I want to create a command that will create + compile a Java file on execution, except I'm not too sure on how to actually do this. Is it possible? Or am I just dreaming?
You could also use Groovy - it's quite handy if you just want to compile and run a line or two of Java code from within your application. The application may be in regular Java, with Groovy used only for compilation of the dynamically generated code. Whichever solution you choose, be careful, as executing user input as code can lead to security issues (vulnerability to injection attacks).
compile a Java file
See the STBC. It uses the JavaCompiler to compile the code in the text area.
I agree with #eee's comment that javax.script is probably a very nice fit for your project, script code is easier to deal with than Java code. I've successfully used it in the past for a plugin API, I don't remember having had any problems to get it up and running.
Most projects that I know of that compile real Java at runtime use the Eclipse compiler to do so. The Java 6 javac can be accessed completely programmatically as well. I've never used either of these myself. These two and some other compilers can be accessed via Commons-JCI if desired.
On MacOS (at least on SnowLeopard), the java command unconditionally adds an extra jar to the classpath:
/System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/.compatibility/14compatibility.jar.
This jar contains a version of Apache Xerces+Xalan, unrenamed. This can cause chaotic results for applications that are trying explicitly to use some other versions of these libraries, particularly in webapps in servlet containers.
I tried to avoid this by using OpenJDK from MacPorts, but the MacPorts build failed for it.
Has anyone worked out some other recipe, other than the obvious violence of deleting that JAR file? It's recommended on one blog, but I fear that some Apple component or another will fail without it.
I haven't had any problems after renaming 14compatibility.jar. Perhaps you could try doing that. If anything breaks horribly, you could move it back in its original place.
I believe the ultimate trump card here is -Xbootclasspath/p:foo.jar . This lets you prepend a .jar to the bootstrap classloader. This should make it take precedence over anything I can imagine. For example you can replace java.lang.String this way.