I am using the janus distro of vim and started to editing some java files..
I have some errors on the left, saying that it can't locate my packages..
Where are those errors are coming from? and how do I ignore those errors?
I took a look (not so deeply) the Janus project, it used syntastic as syntax checker.
Java checker of Syntastic has a command :SyntasticJavacEditClasspath, which allows you to add your classpaths. Also it supports load cp from maven repositories. just take a look the https://github.com/scrooloose/syntastic/blob/master/syntax_checkers/java/javac.vim
hope it helps.
Related
I am trying to install JavaFX and in particular just run this application. I've been using Java for a while and I have to compile from console since IntelliJ just won't load in my laptop. Whenever I try compiling with "javac HelloFX.java" I get a lot of errors and in particular error: package javafx.application does not exist. This is what my java folder looks like
Java Folder
I also already set up a path C:\Program Files\Java\javafx-sdk-18.0.1\lib
I really have no clue as to what I am doing wrong, and the solutions I've been able to find seem rather complex, or use IntelliJ tools. Thank you in advance.
Even if IntelliJ does not work for you, you could still use either Maven or Gradle to build your project which would already simplify things a lot. You should also have a look at the official documentation.
https://openjfx.io/openjfx-docs/
today, I've tried to run my ImageJ plugin My_S but ImageJ always gives off the following Warning:
Plugin or class not found: "My_S"
(java.lang.ClassNotFoundException: My_S)
I think that it kind of skips the compiling step, because there is no My_S.class file in the plugin folder.
This is a little weird, because it worked before (I tried it for one plugin only though).
Then I tried to compile it from the console with
javac My_S.java
which gives off the following qarning:
My_S.java:1: package ij does not exist
import ij.*;
^
So, I tried to re-install it (my system is linux mint btw) but IJ still shows off the same behavior.... : /
Are there any suggestions on how to solve this problem? (I hope this is the right place to ask this question)
Thanks
The "ij package" (that is, all classes in ij.*) is found in the ij jar, e.g. ij-1.50e.jar distributed with your ImageJ installation.
To compile your plugin with javac, see this SO post about adding jars to the classpath.
However, if you are going to be developing ImageJ plugins regularly I encourage you to learn about the software development tools available, like Maven, which will help you manage dependencies and build your compile-time classpath automatically (among other things).
You may also be interested in the ImageJ forum, which reaches a more targeted community for ImageJ-specific development issues.
Is there a way to stop a headless eclipse build for java using the apt compiler if an error has occurred?
A bit of background:
I am trying to build my java project from the command line using
C:\eclipse\eclipsec -nosplash -application org.eclipse.jdt.apt.core.aptBuild -data "../.." -build JavaMain
However, I have recently noticed this compiles my binary even when there are errors in the project such as missing files or missing variables.
I have tried adding -Declipse.exitOnError or removing the -nosplash but it still continues on like a runaway freight train. I have looked for documentation on eclipse apt but all I can find is two pages in their help index which shows me the exact same command I am already using. I checked some other stack overflow questions such as
Build Eclipse Java Project from Command Line
which recommend the same command.
I know that eclipse builds can be done using ant but I was kind of hoping to keep it my project simple with a single command. I know I have to be missing something, there has to be a way for a compiler to report errors.
Also please do not hesitate to correct me on anything I have forgotten to add to this question, this is my first stack overflow post so I am bound to have missed something.
I am trying to get our build machine to consistently build our Blackberry project (build using the Eclipse plugin not the JDE) on check-in. We are using Jenkins to call the project and sometimes it works but only after I've fired up the project in eclipse on the far machine but then restarting causes the error to come back.
The first error I get is (the following errors are all in the same vein):
[javac] c:\<path_to_project>\src\path\to\package\class.java:6: error: package net.rim.device.api.ui does not exist
And every other reference to a net.rim.* object. Clearly it's because it's not linking to the target net_rim_api.jar file but I can't figure out what on earth is going wrong. I've tried poking at the build.xml file but I just get more errors and other versions of this error in other threads turn out to be not the same thing.
I have tried installing and using BB-Ant (roughly following this tutorial) but it has not provided me with the solution - I'm prepared to admit that I may have made a mistake in the implementation but I followed it as closely as I could with the current project that I have.
I would appreciate any help that you can give me.
EDIT
So I've now altered the project to use <rapc> instead of <javac> which appears to do the linking to the .jar for you but it's still frustrating that you can't simply use the auto generated build.xml. Is this a known (and due to lack of information available on the internet, accepted) issue with Eclipse?
I went down the BB Ant build script road a year or so ago, got a lot of help on this site, and tried to document my progress on this site. Hopefully the links I place will help you and others.
I have marked this as "community wiki" since it doesn't directly answer the question but I do think it is useful.
Basic algorithm
My answer on this page shows the algorithm for a working build script (BlackBerry: create COD from JAR source file in Ant script). Perhaps this is more complicated than you are looking for, but it does show the relationship I found between javac and rapc.
To summarise, I wanted to include my SDK into the final build, and the steps were:
javac the SDK to create CLASS files
preverify the CLASS files
jar the SDK
Copy the SDK JAR file into the project
javac the project - use the SDK JAR as the classpath
preverify the project CLASS files (again, use the SDK JAR in the
classpath)
jar the project - add the SDK JAR as a zipfileset
jarjar this project JAR to refactor package names as required
Finally, run rapc on this JAR - it will find no duplicate COD files
& should run fine.
Please read the other answers on that page, since they offer great advice that I used in my end result.
Extra Info & Including a JAR into final output
I'd recommend this page just for the extra links that I included in it - the exact question is unrelated (BlackBerry - Ant script to include JAR in project without external dependancies).
Again, the value is in the answers that the other guys provided.
Misc
Here are a couple of links to other BB build script issues that I had - you or someone may find them useful:
BlackBerry - Ant build script for more complex apps
BlackBerry - final step of build process
Finally this one speaks to a mistake in the documentation when compiling your own code into a library for import into a different project:
BlackBerry - use own JAR file in own project
Hi i've been trying to install the library on Thinking in Java book 4th edition and i hit a very thick brick wall. I've done everything that the guide from the website told me to do and i still can't get the library to work. From what i've read it seems that the problem is from the build.xml files. having no xml knowledge I am clueless about how I have to modify it in order for it to work. In both cmd and eclipse I am getting these error
c:\TIJ4\code\build.xml
Build Failed
c:\TIJ4\code\build.xml:59:J2SE5 required
Can anyone tell me what I should do ?
I am using eclipse if there is a simpler solution by using eclipse rather than ant please help me out. It's been a week now and I still can't make it work.
The important thing to do is to realize that your ant file has a specific java requirement.
Something to try that might fix this very easily : I believe you can remove any references to a specific JDK, and if you have a reasonably up to date JDK, the build will succeed.
The definete fix : Look into the exact (line 59) of your build file, and try to satisfy the java version that line requires. Java is generally backwords compatible -- something designed to run in J2SE5 should run in the latest JDK. Its not terribly difficult to update your JDK (just google for instructions on your OS).
The most common mistake I see is that people who have the java run time installed believe they also have the Java SDK as well.
Does this "install the library" means you want to look at the code and run them in your eclipse? If so I can share my experience with you.
First run the Eclipse.py script; this will add package info to the source code
Create a new Java project in Eclipse, and then just copy all the source code folders to the src source folder in eclipse, these folders will then be recognized as Java packages.
You should be able to run the classes with a main function.
You can also configure which java version to use for this project in Eclipse build path. 1.5 or higher will work.