You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Jens Hofschröer (Jira)" <ji...@apache.org> on 2020/06/30 14:04:00 UTC
[jira] [Created] (NETBEANS-4522) "Run file" does not handle path
with spaces correctly (on Windows)
Jens Hofschröer created NETBEANS-4522:
-----------------------------------------
Summary: "Run file" does not handle path with spaces correctly (on Windows)
Key: NETBEANS-4522
URL: https://issues.apache.org/jira/browse/NETBEANS-4522
Project: NetBeans
Issue Type: Bug
Components: java - Compiler
Affects Versions: 12.0
Environment: NetBeans 12.0
AdoptOpenJDK (build 11.0.7+10) and AdoptOpenJDK (build 13.0.2+8)
Window 10 1809
Reporter: Jens Hofschröer
If I want to run a Sourcefile within the IDE with JDK11+ and the path for the file has spaces the file can not be executed
Steps (in windows cmd.exe):
C:\>md "Path with space"
C:\>cd Path with space
C:\Path with space>echo public class SampleClass{}>SampleClass.java
C:\Path with space>copy con SampleClass.java
public class SampleClass{
public static void main(String[] args){
System.out.println("Sample");
}}^Z
1 Datei(en) kopiert.
C:\Path with space>java SampleClass.java
Sample
C:\Path with space>java %CD%\SampleClass.java
Fehler: Hauptklasse C:\Path konnte nicht gefunden oder geladen werden
Ursache: java.lang.ClassNotFoundException: C:\Path
C:\Path with space>java "%CD%\SampleClass.java"
Sample
C:\Path with space>java "%CD:\=/%/SampleClass.java"
Sample
C:\Path with space>java %CD:\=/%/SampleClass.java
Fehler: Hauptklasse C:.Path konnte nicht gefunden oder geladen werden
Ursache: java.lang.ClassNotFoundException: C:.Path
C:\Path with space>java -Duser.language=en %CD:\=/%/SampleClass.java
Error: Could not find or load main class C:.Path
Caused by: java.lang.ClassNotFoundException: C:.Path
the exact same error message () as the last command is shown if I open this file in NetBeans and call "Run file" from the context menu. So it seems the generate "command line" to execute the file is missing some quotes.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists