run android and java program from servlet - java

Can we run the java program and android application from same project in eclipse?
Actually i have a project in which i am running the android application from web/servlet and in same project i have the java program as well. when i run the android unit test then it get worked but stop working the java program and jvm get crashed. it only work when i removed the android from the bootstrap.
Do we have any way to run the both application from one entry point like servlet?
Thanks.

Why don't you just make two different projects ? The build is not the same between Java and Android so I think you can't get both working on a same run, however it may be possible to make different Run Configurations to launch either in Java or Android.

Related

VSCode for Java on FreeBSD

After installing the Java Extension Pack, Spring Boot Extension Pack, and Lombok, I created a basic Spring Boot project just to test out VSCode (I followed the Spring Boot initializer which works surprisingly well).
I attempted to run the application (barebones / skeleton project) and when clicking on the "Play" button and selecting "Run Java", the Run dialog hangs indefinitely.
I can run the project from the command line, using maven to compile it followed by java -jar; however, I want to be able to do everything in VSCode including running and debugging.
I clicked on "check details", but there isn't any information for me to go by and make an educated guess as to what is going on.
EDIT:
Just to be clear, I am running VSCode on FreeBSD (which is not Linux).
you can have a look on this extension whitch look like Boot Dashboard in Eclipse and it enable you to manage your application and have a control above it andu can run multiple projects using it in this Link.
Note: i think it need java 11 to work
Here is a description of how to use springboot. You can refer to it to see if there is a problem with any operation.
https://code.visualstudio.com/docs/java/java-spring-boot

Run intellij plugin from cli in Windows 10

I'm developing a plugin that analyzes source code in a project. Now I need to run it on a great number of projects, so I decided to automate the process. Looking for a way to achieve this I found that I need to implement ApplicationStarter interface and declaring it as extension point in appStart category, as described here:
Intellij - how to make a plugin that can perform IDE actions via a CLI or web service?
Although, I was not able to execute my custom command. When I run
idea64 mycommand
a loading screen of intellij starts and then nothinng happens. I have to kill the process via task manager. My version Is 2020 on Windows 10.
I'm writing here too as on jetbrains I've received no answers yet.
Is there something i'm missing? Thank you in advance.

Making a Java Console Application

I wonder if it's possible to create a java console application where someone can download my packages, run and use that application in Command Line/Terminal or with some other console application.
I am very well versed in Java & the reason I'm asking is, I have a chess game which I have made to be run in command line, but how do I get it to run like an application?
To wit: On a mac, just like one who has Home brew can download formulas and use their specific commands to begin and run them, how can I do this for an already made application. Do I need a config file? Or is it just good to go as it is.
So I don't want someone to download the package and have to use the "javac/java" command to compile and run it, but can just say something like "run chess" and it does so. Any help or resources would be appreciated
You need to convert your .jar to .exe
There is a lot of software doing this, for example JSmooth.
You need to choose the starting application class and then run it.

Which java server to run a jar application?

I made a java program which runs unit test on my website.
I need the unit test to keep running during the day while I watch the log.
For this, I search a java platform on which I can run my soft. Openshift will be the best because it's easy to install and maintain.
However I will often modify this soft and if the java project could be built whenever I made a commit it will be the best. That's why I think to Jenkins, but I don't know if it is a good way to run a jar from a jenkins server whereas it is made to do build.
I tried JBoss and tomcat by wrapping my programs into an Enterprise Application Client but I can not run and check the log of the program from a web interface.
Currently my project is a Java Application, using MySQL, hibernate, maven and git.
What would be the best option for you ?
Thanks.
Florian C.
Finally, here is my soluce.
I use Jenkins.
When I push on Jenkins, my project is automatically built and ran using a shell script.
If the build or the run fails Jenkins sends me the command output by mail.
Else, every day, the project is run (using the cron of jenkins) and the console output is sent to me by mail, so I can check the result of my test.

NoClassDefFoundError when trying to run Android application

I am using the ADT version 21 plugin for Eclipse, and I am programming for the Android 4.2 platform. I originally wrote a Java client-server application, and I want to use some of the classes that I wrote in it for an Android application that I am writing right now. I tried exporting the Java class files to a JAR file and putting the JAR file in the libs directory in my Android application, but when I tried to run the application on my Nexus 4, a NoClassDefFoundError is thrown. I searched SO for some answers and tried a few suggestions such as including the JAR file in the Order and Export tab in the Properties window (and putting it at the top of the list), but I'm stuck. Eclipse compiles my Android application fine, but I am unable to run my application on my device.
I know this question has been asked before, and several users have experienced this same issue. I welcome all suggestions. (I just started learning about Android application development.) Thanks!
EDIT: I just noticed these lines in the Console output. Any ideas?
[2012-11-24 01:26:26 - HomePage] Dx bad class file magic (cafebabe) or version (0033.0000)
...while parsing org/nihongo/common/db/Commands.class
...while processing org/nihongo/common/db/Commands.class
EDIT: I think it could be the fact that I am using Java 7 instead of Java 6. See here.
NoClassDefFoundError in Java comes when Java Virtual Machine is not able to find a particular class at runtime which was available during compile time.
This error is also generated when you make an app that uses the Google API (such as Maps) but run it on a device that targets the Android API.
I switched my compiler from Java 7 to Java 6 in the client-server application. I exported the class that I wanted to a JAR file, and I included it in my Android application, and it looks like it works now!
So I guess only Java 6 is supported even on Android 4.2.

Categories