Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Alright, so for the past while I've been working on an Operating System style Java application. I've got everything loaded up within an undecorated JFrame, and now I'm ready to turn it into a .ISO or something along those lines. My question, is how would I do this? I've seen articles online saying yes, you can have a Java Operating System, and I've seen examples of some, but I'd like to know HOW. Like if I were to load it into some sort of Virtual Machine, I'd like to do what I've programmed it to do.
If you are planning to run your code as the operating system of a virtual machine, then an ISO is a good choice.
There are existing tools for generating ISO's ... provided you have the "stuff" to go into the ISO.
Your problem is generating the stuff that goes into the ISO; i.e. a bootable operating system image. The problem is that the image must be all native code, and it needs to understand all the low level stuff about how the hardware works; e.g. how to deal with physical / virtual memory mapping, I/O device registers, hardware interrupts, and so on. So you have the problems of implementing the classes (or native code) that does that, and compiling your Java classes into native code and linking it together with everything else to form a bootable operating system image. (And that is just the start ... really)
For those things, there are no existing tools (AFAIK), and little in the way of experience to draw on.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
So I'm currently reading the "Java A Beginners Guide 7th Edition" book. And the following sentences seemed to me that Applets could be used as virusis. Was this done?
An Applet is a special kind of Java program that is designed to be transmitted over the Internet and automatically executed inside a Java-compatible web browser.
The key feature of applets is that they execute locally...
To me it sounds like it wouldn't be hard to build in a virus into an Applet.
The problem with applets is that they run automatically when you load the page. They're also so complex (compared to html or javascript) it was just to complicated to be able to meaningfully secure them. Run Automatically + Complicated to Secure + Doesn't Update Automatically = impossible to completely secure.
Regular apps are far far more dangerous to your machine than applets were. But, they don't run automatically when you visit a web page.
Desktop apps written in languages (like C or C++) where you manipulate the memory with pointers and don't automatically bounds check arrays, are much harder to write securely. Languages (like Java or C#) that don't have pointers and do automatically bounds check arrays are easier to write secure apps in.
Java includes many safewards to prevent any ill behavior, but time after time, those security features were not enough because of different bugs or design problems.
As standalone apps they are as safe or risky as any other app. Just make sure to download your app from trusted sources.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I have a Windows service written by another developer who no longer works with me. It was written in C# with .NET 4.5 requirements. Our solution is making the move to Linux and the daemon naturally needs to be converted.
My dilemma is what to rewrite it in? C++ or Java? The daemon is not complicated. It's simply a controller for our other applications to ensure if they crash or are killed they are restarted. Aside from that it performs health checks through a named pipe and is controlled via a password protected web socket via a separate management Tomcat web interface and writes all of it to logs.
Please put aside any suggestions of "write in what you're most comfortable with" I have a fair amount of experience and knowledge in both languages, and I'll learn whatever else I need to as I go. My concern is the feasibility and effort to accomplish everything I need. I don't have any particular time constraints, but if one language is a fraction of the time of the other then maybe that's a better solution.
Writing it in Java looks like the easiest solution currently, but writing it in C++ has the advantage of being native no-frills code. However, I haven't ever written any web interface or socket code in C++ before, so I do not know the effort involved with that.
To break down my requirements:
Linux
Web interface for control
Named pipe for communicating with client applications
Existing code needs to be heavily refactored
Is C++ or Java more appropriate?
Edit: added more info
Edit2: I guess I should have mentioned that the code needs to be heavily refactored anyways. It was originally written in such a way that renders it difficult to make changes and additions. So rewriting is a cleaner solution at this point. As I mentioned, it's not a large program. Just a controller service.
Porting the solution to .Net Core may the way to go. It will run on Linux (and Mac for all intents and purposes...) and most of your codebase may need minimal refactoring. The only concern is if .Net Core currently has the features you would need supported in the app. And, .Net Core is still in preview.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
In my quest to understand the reasoning to use Java over C++ or vice versa for writing applications, I became stuck on this one point. I watched a video introducing me to Java and they said the reason there is a JVM is because it makes Java portable, meaning it runs on many architectures like phones and stuff without having to write a new compiler for each different CPU OS combo. But people must have to do something to make it compatible with each CPU and OS. I don't see how using a JVM changes anything.
The initial (BETA) versions of Java were derided for being "write once, test everywhere". Improving the quality of the software on the initial platforms (SunOS/Solaris, Windows, Mac, etc) greatly increased its' portability (and portable software is inherently easier to port). Currently, there are multiple implementations of Java (IBM, JRockit, etc).
Fundamentally, Java is the specification of a virtual machine that executes byte codes; and not any particular implementation. Because the byte code is the same across platform the Java compiler doesn't need to be altered to support new platforms. Further, much of the OpenJDK (and, thus, the Oracle JVM) is written in Java. Basically, bootstrapping Java is simplified compared to bootstrapping a compiler for a "real" CPU architecture1.
1Excluding CPUs that natively execute Java byte code.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
This is more of a general programming questions about a GIANT performance issue I have seen..
Basically I'll use two common programs for an example - Eclipse IDE & Newsbin (usenet client)
On my Windows 7 Machine, Eclipse is so sluggish it's almost painful to use and this is built on the java platform right?
Whilst Newsbin, on the same machine, can handle hundreds of thousands of header information and literally NEVER lags.. It's one of the most responsive programmed I have ever used..
So, is there any chance someone could shed some light on which language/platform Newsbin is built upon? I'm curious because I want to expand my skills into desktop applications and there seems to be such a massive difference in performance.
Apologies if this type of question shouldn't be posted here, but it is 'linked' with programming and I would very much like some feedback/answers.
Thanks.
There are many reason the performance could be different. It is most likely a tuning problem or you hardware doesn't suit the application. I use IntelliJ CE (another IDE like Eclipse) and it caches a lot of information about the Java classes it uses. It does this to provide rich refactoring/search capabilities. This can result in enormous amounts of disk activity if you don't have lots of free memory (to cache the disk data). I use a machine with 48 GB of memory and it almost never lags (at least not when I am the only one using it)
My guess is that newsbin of keeps the most essential information about each post and avoids having to cache lots of information about each article. i.e. its has a completely different use and usage pattern.
The performance between the two is most likely not the platform but the fact that the two are very different application.
Second, two version of the same program can be vastly different. You can create a slower Newsbin type application in the same platform that your Newsbin's application uses.
You're comparing apples to oranges: these two programs do completely different things and the performance difference probably has nothing to do with the underlying platform or language.
Also, keep in mind that Eclipse can be fast by itself, but you can ad plugins to it, and poorly written plugins can slow it down horrendously.
Remember: no matter what language you're using, you can always find a way to write code that is poor enough to make a program feel slow and unresponsive.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I was reading item #6.10 on http://www.cafeaulait.org/javafaq.html and I began wondering how the big players go about creating their own implementation of a JVM. Would an experimental something or another be possible (and feasible) for one guy?
technically, all the information people need to create a new JVM is in the public specifications for the language and the targetted platform. A JVM would need to behave differently depending on whether it is meant to run on a desktop computer or a mobile phone, even if the bytecode interpretation would be largely identical.
A few places to start looking for information:
http://en.wikipedia.org/wiki/List_of_Java_virtual_machines
Reading The "Java Virtual Machine Specification" by Tim Lindholm
http://www.jcp.org/en/jsr/detail?id=30
From what I have seen of JVM implementations by Sun, IBM or smaller companies like Esmertec, writing a simple JVM is a several man-months project but adding JSR after JSR to support more functionality can take years afterwards.
Now, if all you need is a simple bytecode interpreter, it's not that bad, but it's still quite a bit of code to write.
A handmade JVM would be a great way to learn about virtual machines in general, the issues of program language design (through the JVM spec), and the nitty gritty of parsing and so forth.
If you choose to take it in that direction, you could also explore optimizations, which is where it can get interesting, and you can take research papers and implement their algorithms.
That being said, if you're less interested in the long and arduous task of creating a VM from scratch, you might want to modify an existing open source VM like Kaffe. It will show you what a virtual machine does, but not necessarily how Java code works in Sun's JVM:
Kaffe is a clean room implementation of the Java virtual machine, plus the associated class libraries needed to provide a Java runtime environment.
This way, you could study the details, but dive in to implementing more interesting features.
I understand that, currently, the big players license the Java library from Sun. They then add their own refinements. The main difference between implementations is the bytecode->machine code compiler.
For one thing, you may want to have a look at Apache Harmony They have come a long way, so their project history may actually give you a good idea on the effort required. I myself would not bet on it being feasible for one guy